Part Number Hot Search : 
TC58NVG 60601B S310BF TA143 NX5501 0603H 182AEPI A1215
Product Description
Full Text Search
 

To Download TMP1942CZUE Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  32bit tx system risc tx19 family tmp1942cyue TMP1942CZUE/xbg rev1.0 march 29, 2007
tx1942cy/cz tmp1942cy/cz-1 32-bit risc microprocessor tx19 family tmp1942cyue/czue/czxbg 1. outline and features the tx19 is a family of high-performance 32-bit microprocessors that offers the speed of a 32-bit risc solution with the added advantage of a significantly reduce code size of a 16-bit architecture. the instruction set of the tx19 includes as a subset the 32-bit instructions of the tx39, which is based on th e mips r3000a tm architecture. additionally, the tx19 supports the mips16 tm application-specific extensions (ase) for improved code density. the tmp1942 is built on a tx19 core processor and a selection of intelligent peripherals. the tmp1942 is suitable for low-voltage, low-power applications. features of the tmp1942 include the following: restrictions on product use 070122ebp ? the information contained herein is subject to change without notice. 021023_d ? toshiba is continually working to improve the quality an d reliability of its products. nevertheless, semiconductor devices in general can malfunction or fail due to their inher ent electrical sensitivity and vulnerability to physical stress. it is the responsibility of the buyer, when utilizing toshiba products, to comply with the standards of safety in making a safe design for the entire system, and to avoid situations in which a malfunction or failure of such toshiba products could cause loss of human life, bodily injury or damage to property. in developing your designs, please ensure that toshiba produc ts are used within specified operating ranges as set forth in the most recent toshiba produc ts specifications. also, please keep in mind the precautions and conditions set forth in the ?handling guide for semiconductor devices, ? or ?toshiba semiconductor reliability handbook? etc. 021023_a ? the toshiba products listed in this document are intend ed for usage in general electronics applications (computer, personal equipment, office equipment, measuring equipmen t, industrial robotics, domestic appliances, etc.). these toshiba products are neither intended nor warranted for usage in equipment that requires extraordinarily high quality and/or reliability or a malfunction or failure of which may cause loss of human life or bodily injury (?unintended usage?). unintended usage include atomic energy control instrument s, airplane or spaceship instruments, transportation instruments, traffic signal instruments, combustion control instruments, medical in struments, all types of safety devices, etc. unintended usage of toshiba products listed in th is document shall be made at the customer?s own risk. 021023_b ? the products described in this document shall not be used or embedded to any downstream products of which manufacture, use and/or sale are prohibited und er any applicable laws and regulations. 060106_q ? the information contained herein is presented only as a guide for the applications of our pr oducts. no responsibility is assumed by toshiba for any infringements of patents or other rights of the third parties which may result from its use. no license is granted by implication or otherwise under any patents or other rights of toshiba or the third parties. 070122_c ? the products described in this document are subject to foreign exchange and foreign trade control laws. 060925_e ? for a discussion of how the reliability of microcontrollers ca n be predicted, please refer to section 1.3 of the chapter entitled quality and reliability assurance/handling precautions. 030619_s
tx1942cy/cz tmp1942cy/cz-2 (1) tx19 core processor 1) two instruction set architecture (isa) modes: 16-bit isa for code density and 32-bit isa for speed ? the 16-bit isa is object-code compatible with the code-efficient mips16 tm ase. ? the 32-bit isa is object-code compatible with the high-performance tx39 family. 2) combines high performance with low power consumption. - high performance ? single clock cycle execution for most instructions ? 3-operand computational instructions for high instruction throughput ? 5-stage pipeline ? on-chip high-speed memory ? dsp function: executes 32-bit x 32-bit multiplier operations with a 64- bit accumulation in a single clock cycle. - low power consumption ? optimized design using a low-power cell library ? programmable standby modes in which processor clocks are stopped 3) fast interrupt response suitable for real-time control ? distinct starting locations for each interrupt service routine ? automatically generated vectors for each interrupt so urce ? automatic updates of the interrupt mask level (2) internal ram: fdue/fdxbg: 20kb,cyue/czue/czxbg: 16 kb internal rom: fdue/fdxbg: 512kb,cyue/czxbg: 384kb,cyue: 256 kb rom correction function (8 words x 4 blocks) (for fdue/fdxbg, only registers are available; data is not replaced.) (3) external memory expansion ? 16-mbyte off-chip address space for code and dat a ? external bus interface with dynamic bus sizing for 8-bit and 16-bit data ports (4) 4-channel dma controller ? interrupt- or software-triggered (5) 6 channel 8-bit pwm timer (12 channel 8-bit interval timer, 6 channel 16-bit interval timer, 6 channel 8-bit ppg output) (6) 14 channel 16-bit timer (2 channels support 2-phase in put pulse counter mode.) (7) 1 channel real-time counter (rtc) (8) 5 channel general-purpose serial interface (supports both uart and synchronous transfer modes) (9) 1 channel serial bus interface either i 2 c bus mode or clock-synchronous mode can be selected. (10) 16 channel 10-bit a/d converter (with internal sample/hold) conversion time: 2 s (throughput), 4 to 5 s (latency) (11) 3 channel 10-bit d/a converter (12) watchdog timer (13) 4 channel chip select/wait controller
tx1942cy/cz tmp1942cy/cz-3 (14) interrupt sources ? 4 cpu interrupts: software interrupt instruction ? 45 internal interrupts: 7 priority levels, with the exception of the watchdog timer interrupt ? 29 external interrupts: 7 priority levels, with the exception of the nmi interrupt the external sources include 14 kwup sources, which are all assigned to a single interrupt vector, and 4 extended in terrupts (intb, intc, intd, and inte), which are all assigned to a single interrupt vector with an identification flag. thus, the actual number of external interrupt sources is 13. (15) 108 pin input/output ports (16) three standby function ? idle, sleep, and stop (17) dual clocks ? rtc clock: low-speed clock (3 2.768 khz) (18) clock generator ? on-chip pll (x4) ? clock gear: divides the operating speed of the cpu by 1/2, 1/4 or 1/8 (19) operating voltage range: 2.7 to 3.6 v pc and pf are 2.7 to 3.6 v or 4.5 to 5.25 v for 5 v-enabled ports. (20) operating frequency ? 32 mh z (vcc 3.0 v) ? 28 mhz (vcc 2.7 v) (21) package ? 144-pin qfp (16 x 16 x 1.4 (t) mm, 0.4-mm pitch): fdue/czue/cyue ? 177-pin csp (13 x 13 x 1.4 (t) mm, 0.8-mm pitch): fdxbg/czxbg note: tmp1942fdxbg (package: 177-pin csp) is under development.
tx1942cy/cz tmp1942cy/cz-4 figure 1.1 tmp1942 block diagram dmac (4ch) tx19 proccessor core g-bus intc ebif i/o bus i/f port0 port1 port2 10-bit adc (16ch) sio0 sio1 serial bus i/f port3 port4 wdt real-time counter (rtc) sio4 sio5 8-bit tmr0/1 a/b (12ch) 16-bit tmr0-d (14ch) tx19 cpu mac dsu 256 kbrom ( * ) 16 kbram cg 10-bit dac (3ch) sio3 intbcde kwup nmi int0 (pf6) int1 2 (pe6 7) int3 4 (pa0 1) int5 6 (pa3 4) int7 (pb7) int8 a (pc0 2) an0 7 (p50 57) an8 15 (p60 67) adtrg (p57) avcc/avss daout0 3 davcc/davss darefh txd0 (pd0) rxd0 (pd1) sclk0/cts0 (pd2) txd1 (pd3) rxd1 (pd4) sclk1/cts1 (pd5) txd3 (pe0) rxd3 (pe1) sclk3/cts3 (pe2) vrefh/vrefl sck (pf3) so/sda (pf4) si/scl (pf5) txd4 (pe3) rxd4 (pe4) sclk4/cts4 (pe5) txd5 (pf0) rxd5 (pf1) tb4in1 (pb5), tb0in0 1 (pa0 1) tb7in0 1 (p95 96), tb1in0 1 (pa3 4) tb8in0 1 (pc6 7), tb2in0 1 (pb0 1) tb9in0 1 (pd0 1), tb3in0 1 (pb3 4) tbain0 1 (pd5 6), tb4in0 (pb2) tb0out (pa2), tb4out (p92) tb1out (pa5), tb5out (p93) tb2out (pb2), tb6out (p94) tb3out (pb5), tb7out (p97) ta1out (pa6), ta7out (pc5) ta3out (pb6), ta9out (pc7) ta5out (pc3), tabout (pd5) jtag sclk5/cts5 (pf2) x1 x2 xt1 (pd6) xt2 (pd7) scout (p44) plloff* reset * bw0/1 intlv (pe7) a d0 7 (p00 p07) a d8/a8 ad15/a15 (p10 p17) a 0/a16 a7/a23 (p20 p27) rd (p30) wr (p31) hwr (p32) wait (p33) busrd (p34) busak * (p35) r/w (p36) p37 cs0 cs3 (p40 p43) intb c (pb0 1) intd e (pb3 4) rom correction ( * ) mrom for the mask rom version. czue/xbg:384kb ta0in (pa7), ta6in (pc1 ) ta2in (pb7), ta8in (pc2 ) ta4in (pc0), taain (pc4 )
tx1942cy/cz tmp1942cy/cz-5 2. signal descriptions this section contains pin assignments for the tmp1942 as well as brief descriptions of the functions of the tmp1942 input and output pins. 2.1 pin assignment table 2.1.1 shows tmp1942 pin assignment. figure 2.1.1 144-pin lqfp pin assignment 144 143 142 141 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 140 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 37 38 39 40 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 41 11 108
tx1942cy/cz tmp1942cy/cz-6 table 2.1.1 pin assignment (144-pin lqfp) pin no. pin name pin no. pin name pin no. pin name pin no. pin name 1 vrefh 37 p11/ad9/a9 73 p90/key8/dclk 109 cvcc 2 vrefl 38 p12/ad10/a10 74 p91/key9/pcst2 110 x2 3 p50/an0 39 p13/ad11/a11 75 p92/tb4out/pcst1 111 cvss 4 p51/an1 40 p14/ad12/a12 76 p93/tb5out/pcst0 112 x1 5 p52/an2 41 p15/ad13/a13 77 p94/tb6out/sdsa0/tpc 113 test1 6 p53/an3 42 p16/ad14/a14 78 p95/tb7in0/dbge 114 reset 7 davcc 43 p17/ad15/a15 79 p96/tb7in1/dint 115 pd6/xt1 8 davss 44 p20/a0/a16 80 p97/tb7out/dreset 116 pd7/xt2 9 dareh 45 p21/a1/a17 81 dvcc3 117 nmi 10 daout0 46 p22/a2/a18 82 pa0/tb0in0/int3 118 bw0 11 daout1 47 p23/a3/a19 83 pa1/tb0in1/int4 119 pb0/tb2in0/intb 12 daout2 48 p24/a4/a20 84 pa2/tb0out 120 pb1/tb2in1/intc 13 p54/an4 49 p25/a5/a21 85 pa3/tb1in0/int5 121 pb2/tb2out/tb4in0 14 p55/an5 50 p26/a6/a22 86 pa4/tb1in1/int6 122 pb3/tb3in0/intd 15 p56/an6 51 p27/a7/a23 87 pa5/tb1out 123 pb4/tb3in1/inte 16 p57/an7/adtrg 52 test0 88 pa6/ta1out 124 pb5/tb3out/tb4in1 17 p60/an8/key0 53 plloff 89 pa7/ta0in/keya 125 pb6/ta3out 18 dvss 54 dvss 90 dvss 126 dvss 19 p61/an9/key1 55 ale 91 rstpup 127 dvcc3 20 p62/an10/key2 56 dvcc3 92 pc0/ta4in/int8 128 pb7/ta2in/int7/keyb 21 p63/an11/key3 57 bw1 93 pc1/ta6in/int9 129 pd0/txd0/tb9in0 22 p64/an12/key4 58 p30/rd 94 pc2/ta8in/inta 130 pd1/rxd0/tb9in1 23 p65/an13/key5 59 p31/wr 95 pc3/ta5out 131 pd2/sclk0/cts0 24 p66/an14/key6 60 p32/hwr 96 pc4/taain 132 pd3/txd1/tbain0 25 p67/an15/key7 61 p33/wait 97 pc5/ta7out 133 pd4/rxd1/tbain1 26 dvcc3 62 p34/busrq 98 pc6/tb8in0/keyc 134 pd5/sclk1/cts1/tabout 27 p00/ad0 63 p35/busak 99 pc7/tb8in1/ta9out 135 pe0/txd3 28 p01/ad1 64 p36/r/w 100 dvcc52 136 pe1/rxd3 29 p02/ad2 65 p37/dsu 101 pf0/txd5 137 pe2/sclk3/cts3 30 p03/ad3 66 dvss 102 pf1/rxd5/keyd 138 pe3/txd4 31 p04/ad4 67 dvcc3 103 pf2/sclk5/cts5 139 pe4/rxd4 32 p05/ad5 68 p40/cs0 104 pf3/sck 140 pe5/sclk4/cts4 33 p06/ad6 69 p41/cs1 105 pf4/so/sda 141 pe6/int1/boot 34 p07/ad7 70 p42/cs2 106 pf5/si/scl 142 pe7/int2/intlv 35 dvss 71 p43/cs3 107 pf6/int0 143 avcc 36 p10/ad8/a8 72 p44/scout 108 dvcc51 144 avss
tx1942cy/cz figure 2.1.2 shows pin assignment for the 177-pin model of the tmp1942. a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 e1 e2 e3 e4 e12 e13 e14 e15 f1 f2 f3 f4 f12 f13 f14 f15 g1 g2 g3 g4 g12 g13 g14 g15 h1 h2 h3 h4 h12 h13 h14 h15 j1 j2 j3 j4 j12 j13 j14 j15 k1 k2 k3 k4 k12 k13 k14 k15 l1 l2 l3 l4 l12 l13 l14 l15 m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12 m13 m14 m15 n1 n2 n3 n4 n5 n6 n7 n8 n9 n10 n11 n12 n13 n14 n15 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 figure 2.1.2 177-pin csp pin assignment tmp1942cy/cz-7
tx1942cy/cz tmp1942cy/cz-8 table 2.1.2 pin assignment (177-pin csp) pin no. pin name pin no. pin name pin no. pin name pin no. pin name a1 vrefl d1 p50/an0 h13 nc n4 p16/ad14/a14 a2 avss d2 davss h14 nc n5 p21/a1/a17 a3 avcc d3 p52/an2 h15 dvss n6 p25/a5/a21 a4 pe7/int2/intlv d4 p51/an1 j1 p67/an15/key7 n7 dvss a5 pe3/txd4 d5 pe0/txd3 j2 p65/an13/key5 n8 test0 a6 tck (jtag) d6 pd3/txd1/tbain0 j3 p66/an14/key6 n9 p30/rd a7 pd2/sclk0/cts0 d7 pb7/ta2in/int7/keyb j4 p64/an12/key4 n10 p32/hwr a8 pb5/tb3out/tb4in1 d8 dvss j12 pa6/ta1out n11 p37 a9 pb1/tb2in1/intc d9 pb2/tb2out/ tb4in0 j13 pa7/ta0in/keya n12 dvss a10 pd7/tx2 d10 nmi j14 nc n13 p41/cs1 a11 pd6/tx1 d11 nc j15 pa5/tb1out n14 p91/key9 a12 x1 d12 nc k1 p01/ad1 n15 nc a13 x2 d13 pf1/rxd5/keyd k2 dvcc3 p1 nc a14 cvcc d14 pf3/sck k3 nc p2 p10/ad8/a8 a15 nc d15 pf6/int0 k4 nc p3 p12/ad10/a10 b1 nc e1 davcc k12 pa2/tb0out p4 p20/a0/a16 b2 nc e2 daout0 k13 pa3/tb1in0/int5 p5 p22/a2/a18 b3 pe6/int1 e3 darefh k14 pa4/tb1in1/int6 p6 p26/a6/a22 b4 pe4/rxd4 e4 p53/an3 k15 pa1/tb0in1/int4 p7 tdo (jtag) b5 trst (jtag) e5 nc (bonding not applied) l1 p04/ad4 p8 ale b6 pd5/sclk1/cts1/tabout e12 pc6/tb8in0/keyc l2 p02/ad2 p9 bw1 b7 pd0/txd0/tb9in0 e13 dvcc52 l3 tms (jtag) p10 p33/wait b8 dvcc3 e14 pf0/txd5 l4 p00/ad0 p11 tdi (jtag) b9 pb4/tb3in1/inte e15 pf2/sclk5/cts5 l12 p97/tb7out p12 p40/cs0 b10 pb0/tb2in0/intb f1 daout1 l13 dvcc3 p13 p42/cs2 b11 nc f2 p55/an5 l14 pa0/tb0in0/int3 p14 p44/scout b12 reset f3 p54/an4 l15 p96/tb7in1 p15 nc b13 cvss f4 daout2 m1 p07/ad7 r1 p11/ad9/a9 b14 dvcc51 f12 pc2/ta8in/inta m2 p05/ad5 r2 nc b15 nc f13 pc4/taain m3 p03/ad3 r3 nc c1 vrefh f14 pc5/ta7out m4 p14/ad12/a12 r4 p13/ad11/a11 c2 nc f15 pc7/tb8in1/ta9out m5 p15/ad13/a13 r5 p17/ad15/a15 c3 pe5/sclk4/cts4 g1 p56/an6 m6 p24/a4/a20 r6 p23/a3/a19 c4 pe2/sclk3/cts3 g2 p61/an9/key1 m7 plloff r7 p27/a7/a23 c5 pe1/rxd3 g3 nc m8 nc r8 nc c6 pd4/rxd1/tbain1 g4 p60/an8/key0 m9 dvcc3 r9 p31/wr c7 pd1/rxd0/tb9in1 g12 pc0/ta4in/int8 m10 p34/busrq r10 p35/busak c8 pb6/ta3out g13 pc1/ta6in/int9 m11 p36/r/w r11 dvcc3 c9 pb3/tb3in0/intd g14 nc m12 p93/tb5out r12 nc c10 bw0 g15 pc3/ta5out m13 p94/tb6out r13 p43/cs3 c11 nc h1 dvss m14 p95/tb7in0 r14 nc c12 test1 h2 p63/an11/key3 m15 p92/tb4out r15 p90/key8 c13 pf4/so/sda h3 p57/an7/adtrg n1 nc c14 pf5/si/scl h4 p62/an10/key2 n2 dvss c15 nc h12 rstpup n3 p06/ad6
tx1942cy/cz 2.2 pin usage information table 2.2.1 lists the names and functions of the tmp1942?s input/output pins. table 2.2.1 pin names and functions pin name # of pins type function p00~p07 ad0~ad7 8 input/output input/output port 0: individually programmable as input or output address (lower): bits 0-7 of the address/data bus p10~p17 ad8~ad15 a8~a15 8 input/output input/output output port 1: individually programmable as input or output address/data (upper): bits 8-15 of the address/data bus address: bits 8-15 of the address bus p20~p27 a0~a7 a16~a23 8 input/output output output port 2: individually programmable as input or output address: bits 0-7 of the address bus address: bits 16-23 of the address bus p30 rd 1 output output port 30: output-only read strobe: asserted during a read operation from an external memory device p31 wr 1 output output port 31: output-only write strobe: asserted during a write operation on d0-d7 p32 hwr 1 input/output output port 32: programmable as input or output (with internal pull-up resister) higher write strobe: asserted during a write operation on d8-d15 p33 wait 1 input/output input port 33: programmable as input or output (with internal pull-up resister) wait: causes the cpu to sus pend external bus activity p34 busrq 1 input/output input port 34: programmable as input or output (with internal pull-up resister) bus request: asserted by an external bus master to request bus mastership p35 busak 1 input/output output port 35: programmable as input or output (with internal pull-up resister) bus acknowledge: indicates that the cp u has relinquished the bus in response to busrq . p36 r/w 1 input/output output port 36: programmable as input or output (with internal pull-up resister) read/write: indicates the direction of data transfer on the bus: 1 = read or dummy cycle, 0 = write cycle p37 dsu 1 input/output input port 37: programmable as input or output (with internal pull-up resister) this pin is used to select the operating mode during reset. the tmp1940cyaf enters normal mode when this pin is sa mpled high at the rising edge of reset . this pin should not be pulled down to a logic 0 dur ing a reset sequence. the tmp1940fdbf, which has an on-chip flash, uses this pin as an interface to the dsu tool. for details, refer to part 4, tmp1940fdbf . p40 cs0 1 input/output output port 40: programmable as input or output (with internal pull-up resister) chip select 0: asserted low to enable external devices at programmed addresses p41 cs1 1 input/output output port 41: programmable as input or output (with internal pull-up resister) chip select 1: asserted low to enable external devices at programmed addresses p42 cs2 1 input/output output port 42: programmable as input or output (with internal pull-up resister) chip select 2: asserted low to enable external devices at programmed addresses p43 cs3 1 input/output output port 43: programmable as input or output (with internal pull-up resister) chip select 3: asserted low to enable external devices at programmed addresses p44 scout 1 input/output output port 44: programmable as input or output system clock output: drives out a cloc k signal at the same frequency as the cpu clock (high-speed or low-speed) p50~p57 an0~an7 adtrg 8 input input input port 5: input-only analog input: input to the a/d converter external start request for the a/d converter (multiplexed with p57) p60~p67 an8~an15 key0-key7 1 input/output input output port 6: input-only analog input: input to the a/d converter key on wake-up input (with internal pull- up resister) (dynamic pull-up selectable) p90 dsu (dclk) key8 1 input/output output input port 90: programmable as input or output dsu pin key on wake-up input (with internal pull- up resister) (dynamic pull-up selectable) tmp1942cy/cz-9
tx1942cy/cz tmp1942cy/cz-10 pin name # of pins type function p91 dsu (pcst2) key9 1 input/output output input port 91: programmable as input or output dsu pin key on wake-up input (with internal pull- up resister) (dynamic pull-up selectable) p92 dsu (pcst1) tb40ut 1 input/output output output port 92: programmable as input or output dsu pin 16-bit timer 4 output: output from 16-bit timer 4 p93 dsu (pcst0) tb5out 1 input/output output output port 93: programmable as input or output dsu pin 16-bit timer 5 output: output from 16-bit timer 5 p94 dsu (sdsa0/tpc) tb6out 1 input/output output output port 94: programmable as input or output dsu pin 16-bit timer 6 output: output from 16-bit timer 6 p95 dsu (dbge * ) tb7in0 1 input/output input port 95: programmable as input or output dsu pin 16-bit timer 7 input 0: count/captur e trigger input to 16-bit timer 7 p96 dsu (dint * ) tb7in1 1 input/output input port 96: programmable as input or output dsu pin 16-bit timer 7 input 1: capture trigger input to 16-bit timer 7 p97 dsu (dreset) tb7out 1 input/output input output port 97: programmable as input or output dsu pin 16-bit timer 7 output: output from 16-bit timer 7 pa0 tb0in0 int3 1 input/output input input port a0: programmable as input or output 16-bit timer 0 input 0: count/capture trigger input to 16-bit timer 0 interrupt request 3: programmable to be high-level, low-level, rising-edge or falling-edge sensitive pa1 tb0in1 int4 1 input/output input input port a1: programmable as input or output 16-bit timer 0 input 1: capture trigger input to 16-bit timer 0 interrupt request 4: programmable to be high-level, low-level, rising-edge or falling-edge sensitive pa2 tb0out 1 input/output output port a2: programmable as input or output 16-bit timer 0 output: output from 16-bit timer 0 pa3 tb1in0 int5 1 input/output input input port a3: programmable as input or output 16-bit timer 1 input 0: count/capture trigger input to 16-bit timer 1 interrupt request 5: programmable to be high-level, low-level, rising-edge or falling-edge sensitive pa4 tb1in1 int6 1 input/output input input port a4: programmable as input or output 16-bit timer 1 input 1: capture trigger input to 16-bit timer 1 interrupt request 6: programmable to be high-level, low-level, rising-edge or falling-edge sensitive pa5 tb1out 1 input/output output port a5: programmable as input or output 16-bit timer 1 output: output from 16-bit timer 1 pa6 ta1out 1 input/output output port a6: programmable as input or output 8-bit timer 0/1 output: output from 8-bit timer 0 or 1 pa7 ta0in keya 1 input/output input input port a7: programmable as input or output 8-bit timer 0 input: input to 8-bit timer 0 key on wake-up input (with internal pull- up resister) (dynamic pull-up selectable) pb0 tb2in0 intb 1 input/output input input port b0: programmable as input or output 16-bit timer 2 input 0: count/capture trigger input/2-phase input pulse counter input to 16-bit timer 2 interrupt request b: programmable to be high-level, low-level, rising-edge or falling-edge sensitive
tx1942cy/cz pin name # of pins type function pb1 tb2in1 intc 1 input/output input input port b1: programmable as input or output 16-bit timer 2 input 1: capture trigger inpu t/2-phase input pulse counter input to 16-bit timer 2 interrupt request c: programmable to be high-level, low-level, rising-edge or falling-edge sensitive pb2 tb2out tb4in0 1 input/output output input port b2: programmable as input or output 16-bit timer 2 output: output from 16-bit timer 2 16-bit timer 4 input 0: count/captur e trigger input to 16-bit timer 4 pb3 tb3in0 intd 1 input/output input input port b3: programmable as input or output 16-bit timer 3 input 0: count/capture trigger input/2-phase input pulse counter input to 16-bit timer 3 interrupt request d: programmable to be high-level, low-level, rising-edge or falling-edge sensitive pb4 tb3in1 inte 1 input/output input input port b4: programmable as input or output 16-bit timer 3 input 1: capture trigger inpu t/2-phase input pulse counter input to 16-bit timer 3 interrupt request e: programmable to be high-level, low-level, rising-edge or falling-edge sensitive pb5 tb3out tb4in1 1 input/output output input port b5: programmable as input or output 16-bit timer 3 output: output from 16-bit timer 3 16-bit timer 4 input 1: capture trigger input to 16-bit timer 4 pb6 ta3out 1 input/output output port b6: programmable as input or output 8-bit timer 2/3 output: output from 8-bit timer 2 or 3 pb7 ta2in int7 keyb 1 input/output input input input port b7: programmable as input or output 8-bit timer 2 input: input to 8-bit timer 2 interrupt request 7: programmable to be high-level, low-level, rising-edge or falling-edge sensitive key on wake-up input (with internal pull- up resister) (dynamic pull-up selectable) pc0 ta4in int8 1 input/output input input port c0: programmable as input or output 8-bit timer 4 input: input to 8-bit timer 4 interrupt request 8: programmable to be high-level, low-level, rising-edge or falling-edge sensitive pc1 ta6in int9 1 input/output input input port c1: programmable as input or output 8-bit timer 6 input: input to 8-bit timer 6 interrupt request 9: programmable to be high-level, low-level, rising-edge or falling-edge sensitive pc2 ta8in inta 1 input/output input input port c2: programmable as input or output 8-bit timer 8 input: input to 8-bit timer 8 interrupt request a: programmable to be high-level, low-level, rising-edge or falling-edge sensitive pc3 ta5out 1 input/output output port c3: programmable as input or output 8-bit timer 4/5 output: output from 8-bit timer 4 or 5 pc4 taain 1 input/output input port c4: programmable as input or output 8-bit timer a input: input to 8-bit timer a pc5 ta7out 1 input/output output port c5: programmable as input or output 8-bit timer 6/7 output: output from 8-bit timer 6 or 7 pc6 tb8in0 keyc 1 input/output input input port c6: programmable as input or output 16-bit timer 8 input 0: count/captur e trigger input to 16-bit timer 8 key on wake-up input (with internal pull- up resister) (dynamic pull-up selectable) pc7 tb8in1 ta9out 1 input/output input output port c7: programmable as input or output 16-bit timer 8 input 1: capture trigger input to 16-bit timer 8 8-bit timer 8/9 output: output from 8-bit timer 8 or 9 pd0 txd0 tb9in0 1 input/output output input port d0: programmable as input or output serial transmit data 0 programmable as an open-drain output 16-bit timer 9 input 0: count/captur e trigger input to 16-bit timer 9 tmp1942cy/cz-11
tx1942cy/cz tmp1942cy/cz-12 pin name # of pins type function pd1 rxd0 tb9in1 1 input/output input input port d1: programmable as input or output serial receive data 0 16-bit timer 9 input 1: capture trigger input to 16-bit timer 9 pd2 sclk0 cts0 * 1 input/output input/output input port d2: programmable as input or output serial clock input/output 0 serial clear-to-send 0 programmable as an open-drain output pd3 txd1 tbain0 1 input/output output input port d3: programmable as input or output serial transmit data 1 programmable as an open-drain output 16-bit timer a input 0: count/captur e trigger input to 16-bit timer a pd4 rxd1 tbain1 1 input/output input input port d4: programmable as input or output serial receive data 1 16-bit timer a input 1: capture trigger input to 16-bit timer a pd5 sclk1 cts1 tabout 1 input/output input/output input output port d5: programmable as input or output serial clock input/output 1 serial clear-to-send 1 programmable as an open-drain output 8-bit timer a/b output: output from 8-bit timer a or b pd6 xt1 1 input/output input port d6: programmable as input or open-drain output connection pin for a low-speed crystal pd7 xt2 1 input/output output port d7: programmable as input or open-drain output connection pin for a low-speed crystal pe0 txd3 1 input/output output port e0: programmable as input or output serial transmit data 3 programmable as an open-drain output pe1 rxd3 1 input/output input port e1: programmable as input or output serial receive data 3 pe2 cts3 * 1 input/output input/output input port e2: programmable as input or output serial clock input/output 3 serial clear-to-send 3 programmable as an open-drain output pe3 txd4 1 input/output output port e3: programmable as input or output serial transmit data 4 programmable as an open-drain output pe4 rxd4 1 input/output input port e4: programmable as input or output serial receive data 4 pe5 sclk4 cts4 1 input/output input/output input port e5: programmable as input or output serial clock input/output 4 serial clear-to-send 4 programmable as an open-drain output pe6 int1 boot 1 input/output input port e6: programmable as input or output interrupt request 1: individually programmable to be high-level, low-level, rising-edge or falling-edge sensitive. single-boot mode setting pin: used when rewrit ing built-in flash memory (low active). during normal operation, this pin should be pulled up. this pin should always be pulled up for the mask rom version. pe7 int2 intlv 1 input/output input port e7: programmable as input or output interrupt request 2: individually programmable to be high-level, low-level, rising-edge or falling-edge sensitive. interleave mode setting pin: th is pin should be pulled up w hen using interleave mode. otherwise, it should be pulled down. pf0 txd5 1 input/output output port f0: programmable as input or output serial transmit data 5 programmable as an open-drain output
tx1942cy/cz tmp1942cy/cz-13 pin name # of pins type function pf1 rxd5 keyd 1 input/output input input port f1: programmable as input or output serial receive data 5 key on wake-up input (with internal pull- up resister) (dynamic pull-up selectable) pf2 sclk5 cts5 1 input/output input/output input port f2: programmable as input or output serial clock input/output 5 serial clear-to-send 5 programmable as an open-drain output pf3 sck 1 input/output input/output port f3: programmable as input or output clock input/output pin when the serial bus interface is in sio mode pf4 so sda 1 input/output output input/output port f4: programmable as input or output data transmission pin when the serial bus interface is in sio mode data transmission/reception pin when t he serial bus interface is in i 2 c mode programmable as an open-drain output pf5 si scl 1 input/output input input/output port f5: programmable as input or output data reception pin when the serial bus interface is in sio mode clock input/output pin when the se rial bus interface is in i 2 c mode programmable as an open-drain output pf6 int0 input/output input port f6: programmable as input or output interrupt request 0: individually programmable to be high-level, low-level, rising-edge or falling-edge sensitive. ale 1 output address latch enable (this signal is driven out only when external memory is accessed) test0 1 input test pin test1 1 input test pin rstpup 1 input when this pin is driven high (upon reset), pull-up for ports 3 and 4 is enabled. when this pin is driven low, pull-up is disabled. daout0-2 3 output d/a converter output nmi 1 input non-maskable interrupt request: causes an nmi interrupt on the falling edge bw0~1 2 input set both am0 and am1 to 1. plloff 1 input this pin should be tied to logic 1 when the frequency multiplied clock from the pll is used; otherwise, it should be tied to logic 0. reset 1 input reset (with internal pull-up resister): initializes the whole tmp1940cyaf vrefh 1 input input pin for high reference voltage for the a/d converter. vrefl 1 input input pin for low reference voltage for the a/d converter. avcc 1 ? power supply pin for the a/d converter. th is pin should always be connected to power supply even when the a/d converter is not used. avss 1 ? ground pin for the a/d converter. this pi n should always be connected to ground even when the a/d converter is not used. davcc 1 ? power supply pin for the d/a converter. th is pin should always be connected to power supply even when the d/a converter is not used. davss 1 ? ground pin for the d/a converter. this pi n should always be connected to ground even when the d/a converter is not used. darefh 1 ? reference voltage input pin for the d/a converter x1/x2 2 input/output resonator connecting pin cvcc 1 ? power supply pin for the oscillator cvss 1 ? ground pin for the oscillator (0 v) dvcc3 4 ? power supply pins dvcc51 1 ? power supply pin (port f) dvcc52 1 ? power supply pin (port c) dvss 5 ? ground pins (0 v) port c becomes a 5 v port when a 5 v power supply is connected to dvcc52. port f becomes a 5 v port when a 5 v power supply is connected to dvcc51. note: when the dsu is enabled, port 9 functions as the processor probe interfacing signal regardless of the setting of the port 9 control register (p9cr).
tx1942cy/cz tmp1942cy/cz-14 the following table lists the jtag specific pins added to the csp package: pin name # of pins type function trst 1 input jtag reset pin (with internal pull-up resistor) tck 1 input jtag clock pin (with internal pull-up resistor) tdi 1 input jtag data input pin (with internal pull-up resistor) tdo 1 output jtag data output pin tms 1 input jtag mode switching input pin (with internal pull-up resistor)
tmp1942cy/cz tmp1942cy/cz-15 3. functional description this section describes the functions and basic operation of each individual circuit bl ock in the tmp1942 series devices . 3.1 processor core the tx1942 contains a high - performance 32 - bit processor core ( the tx19 processor core ). for details of the operation of the processor core , refer to ? tx19 family architecture ?. functions unique to the tmp1942 , which are not explained in ? tx19 family architecture ?, are described below . 3.1.1 reset operation to reset the tmp1942 , reset must be input low ( at 0 ) for at least 12 system clock cycles while the power supply voltage is within the rated operating range and the internal high - frequency oscillator is oscillating stably . ( with the device operating at 32 mhz , this period is equal to 3 s if the pll is being used and 6 s if the pll is not being used .) after a reset the pll - multiplied clock is specified by the setting of the plloff pin and the clock gear is initialized to 1 / 8 mode . to reset the tmp1942 , reset must be asserted for at least 12 system clock periods after the power supply voltage and the internal high - frequency oscillator have stabilized . this time is typically 3 s at 32 mhz when the on - chip pll is utilized , and 6 s otherwise . after a reset , either the pll - multiplied clock or an external clock is selected , depending on the logic state of the plloff pin . by default , the selected clock is geared down to 1 / 8 for internal operation . the following occurs as a result of a reset : ? the system control coprocessor ( cp0 ) registers within the tx19 core processor are initialized . for details , refer to the architecture manual . ? the reset exception is taken . program control is transferred to the exception handler at a predefined address . this predefined location is called an exception vector , which directly indicates the start of the actual exception handler routine . the reset exception is always vectored to virtual address 0xbfc0 _ 0000 ( which is the same as for the nonmaskable interrupt exception ). ? all on - chip i / o peripheral registers are initialized . ? all port pins , including those multiplexed with on - chip peripheral functions , are configured as either general - purpose inputs or general - purpose outputs . recommended power-on sequence: in powering up this device, it is reco mmended that the dvcc3 be turned on first. at power-on, the pull-up resistor s and input & output buffers pull-down resistors attached to the i/o ports of the 5v supply domain may rail become unstable or a through current may pass through the port until the dv cc3 has stabilized, when an in jection order is not kept.
tmp1942cy/cz tmp1942cy/cz-16 3.2 memory map figure 3.2.1 shows a memory map of the tmp1942 . figure 3.2.1 memory map note 1: the internal rom is mapped into the memory spac e from 0x1fc0_0000 to 0x1fc3_ffff (for a 256-kb rom) or 0x1fc0_0000 to 0x1fc5_ffff (for a 384-kb rom). the in ternal ram is mapped into the memory space from 0xffff_8000 to 0xffff_bfff (for a 16-kb ram). note 2: the memory space from 0xffff_4000 to 0xffff_bfff is a reserved ram area. any area other than those shown above, where physical memory is located, should not be accessed. note 3: the internal memory data is stored in conti guous physical address locations starting at 0x1fc0_0000. if exception vector addresses are placed in internal rom, the system control coprocessor (cp0) status register's bev bit must be set to 1 (the default). (this is because exception vector addresses are dispersed if bev = 0.) if memory is added externally, the bev bit can be set to 0. however, since a virtual address space of 0x0000_0000 32 kb is easier to access for reasons of code efficiency, this area is reflected in the contiguous physic al address space from 0x4000_0000 upwards (as indicated by the shaded area) which corresponds to a virtual address space starting at 0x0000_0000 and which is equal in size to the internal memory. hence, accessing this area is equivalent to accessing the internal memory. example: using 32-bit isa ? access to the 0x0000_0000 32 kb area addiu r2, r0, 7 ; r 2 (0x0000_0007) sw r2, io (_t) (r0) ; 0x0000_xxxx (r2) can be accessed using a single instruction. ? access to areas other than 0x0000_0000 32 kb lui r3, hi (_f) ; upper address is set to r3. addiu r2, r0, 8 ; r2 (0x0000_0008) sw r2, io (_f) (r3) ; memory is accessed after lower address has been set. note 4: the tx1942 supports access to only 16 mbytes of physical space as external address space. a 16-mbyte physical address space can be placed in any chip-select area within the cpu's 3.5 gbytes of physical address space. however, when access to the internal memory, internal i/o space or a reserved area is performed, the external address space cannot be accessed simultaneously, since the other types of access have priority. note 5: do not place an instruction in the last four words of the physical area. ? the relevant area of the internal rom is 0x1fc3_fff0 to 0x1fc3_ffff (for a 256-kb rom) or 0x1fc5_fff0 to 0x1fc5_ffff (for a 384-kb rom). ? if rom is added externally, this restriction applies to the last four words of the installed memory (system-dependent). internal rom area reflected 0xffff_ffff virtual address 16 mbytes reserved kseg1 (uncacheable) kseg2 (cacheable) 16 mbytes reserved kseg0 (cacheable) kuseg (cacheable) 0xff00_0000 0xc000_0000 0xbfc0_0000 0xa000_0000 0x8000_0000 0x0007_ffff 0x0000_0000 physical address kseg2 (1 gbyte) cannot be accessed internal rom 512 mbytes internal i/o (reserved) internal ram (16kb) reserved for debugging (2 mb) user program area exception vector area 0xffff_e000 0xffff_afff 0xffff_7000 (reserved) 0xff3f_ffff 0x4003_ffff 0x4000_0000 0x1fc3_ffff 0x1fc0_0000 0xff20_0000 (reserved) maskable interrupt area 0xff00_0000 0x1fc3_ffff 0x1fc0_0400 0x1fc0_0000 16 mbytes reserved 16 mbytes reserved kuseg (2gbyte)
tmp1942cy/cz tmp1942cy/cz-17 3.3 clock/standby control there are essentially two modes of clock operation : single - clock mode ( which uses only the x1 and x2 pins ) and dual - clock mode ( which uses the x1 and x2 pins as well as the xt1 and xt2 pins ). figure 3.3.1 shows the state transition dia g ram for each operation mode . (a) state transition in single-clock mode note 1: before transition to slow/sleep mode can occur, the low-speed oscillator (fs) must be oscillating stably. note 2: when sleep mode is terminated, the device returns to the state in which it was placed before entering sleep mode. note 3: the state to which the device returns when stop mode is terminated can be specified us ing system control register syscr0. (b) state transition in dual-clock mode figure 3.3.1 state transition diagrams for different modes figure 3.3.32 default states when the pll is used and those when the pll is not used fosc : clock frequency input via x1 and x2 pins fs : clock frequency input via xt1 and xt2 pins fpll: clock frequency multiplied ( x4 ) by pll fc : clock frequency selected by setting of plloff pin fgear : clock frequency selected by syscr1 < gear1 : gear0 > system clock fsys : clock frequency selected by syscr1 < sysck > fperiph : input clock for peripheral i / o prescaler reset reset terminated idle mode (cpu halted) (i/o select operation) instruction interrupt normal mode (fc/gear value) instruction interrupt stop mode (all circuits turned off) reset reset terminated idle mode (cpu halted) (i/o select operation) instruction interrupt normal mode (fc/gear value) instruction stop mode (all circuits turned off) slow mode (fs) instruction instruction interrupt interrupt instruction instruction interrupt sleep mode (fc only) (only real-time clock timer operating) interrupt reset reset normal mode fc fpll fosc u 4 fsys fc/8 ? fsys fosc/2 fperiph fsys normal mode fc fosc/2 fsys fc/8 ? fsys fosc/16 fperiph fsys a. when a clock generated by the pll is used b. when the pll is not used reset terminated plloff pin (high) pll clock used reset terminated plloff pin (low) pll not used
tmp1942cy/cz tmp1942cy/cz-18 3.3.1 block diagram of clock circuits 1. main system clock ? a crystal can be connected between x1 and x2 , or x1 can be externally driven with a clock . ? plloff the on - chip pll can be enabled or disabled ( bypassed ) during reset by using the plloff pin . when the pll is enabled , the input clock frequency is multiplied by four . ? the clock gear can be programmed to divide the clock by 2 , 4 or 8 . ( the default is 1 / 8 on reset .) ? input clock frequency input frequency range fmax fmin pllon (for both resonator and external input) 5~8 (mhz) 32 mhz 2.5 mhz resonator 16~20 (mhz) 20 mhz 1 mhz 16~20 (mhz) 20 mhz 1 mhz plloff external input 20 32 (mhz) 16 mhz *1 1.25 mhz * 1 . syscr1 must be 0. the default is 0.  2. sub - system clock ? generated using a 32 . 768 - khz resonator ( external input also accepted ). ? slow mode : the cpu runs at low speed . ? sleep mode : only the timer for real - time clock , 2 - phase pulse input counter , and dynamic pull - up operate .
tmp1942cy/cz tmp1942cy/cz-19 3. block diagram note 1: when using the clock gear to reduce the system clock frequency, make sure that tn of the prescaler output for each peripheral i/o block satisfies the following relationship: tn syscr0 syscr2 syscr3 warm-up timer lock-up (pll) timer selector 2 4 8 fperiph (to peripheral i/o) 2 syscr1 pll plloff (default pin setting) syscr1 syscr1 divide by 8 after reset cpu rom ram dmac intc syscr0 fsys fperiph 2 syscr0 fs syscr3 scout fgear syscr1
tmp1942cy/cz tmp1942cy/cz-20 3.3.2 clock generator (cg) registers (1) clock - related registers 7 6 5 4 3 2 1 0 syscr0 bit symbol xen xten rxen rxten rsysck wuef prck1 prck0 (0xffff_ee00) read/write r/w after reset 1 0 1 0 0 0 0 0 function high-speed oscillator 0: turned off 1: oscillating low-speed oscillator 0: turned off 1: oscillating high-speed oscillator after exit from stop mode 0: turned off 1: oscillating low-speed oscillator after exit from stop mode 0: turned off 1: oscillating clock selection after exit from stop mode 0: high speed 1: low speed oscillator warm-up timer (wup) control write 0: don't care write 1: wup start read 0: wup finished read 1: wup operating prescaler clock selection 00: fperiph/4 01: fperiph/2 10: fperiph 11: (reserved) 15 14 13 12 11 10 9 8 syscr1 bit symbol sysck fpsel dfosc gear1 gear0 (0xffff_ee01) read/write r/w r/w after reset - - 0 0 0 - 1 1 function system clock selection 0: high speed (fc) 1: low speed (fs) fperiph selection 0: fgear 1: fc high-speed oscillator frequency division selection 0: divide by 2 1: divide by 1 high-speed clock (fc) gear selection 00: fc 01: fc/2 10: fc/4 11: fc/8 23 22 21 20 19 18 17 16 syscr2 bit symbol drvosch drvoscl wupt1 wupt0 stby1 stby0 drve (0xffff_ee02) read/write r/w - r/w after reset 0 0 1 0 1 1 - 0 function high-speed oscillator driving capability control 0: normal 1: weak low-speed oscillator driving capability control 0: normal 1: weak oscillator warm-up time selection 00: 2 2 /input frequency 01: 2 8 /input frequency 10: 2 14 /input frequency 11: 2 16 /input frequency standby mode selection 00: reserved 01: stop mode 10: sleep mode 11: idle mode 1: pins are also driven in stop mode. 31 30 29 28 27 26 25 24 syscr3 bit symbol scosel alesel lupfg luptm (0xffff_ee03) read/write - r/w - r/w - - r r/w after reset - 0 - 1 - - 0 0 function scout output selection 0: fs 1: fsys ale output width selection 0: fsys 0.5 1: fsys 1.5 lock-up flag 0: lup finished 1: lup in operation lock-up time selection 0: 2 16 /input frequency 1: 2 12 /input frequency
tmp1942cy/cz tmp1942cy/cz-21 note 1: standby mode selection depends on the settings of the doze and halt bits in the cp0's internal config register. if the halt bit = 1, the dev ice will enter the mode selected by stby[1:0]. if the doze bit = 1, the device will always enter idle mode. note 2: when the pll is not used, set the luptm bit in the syscr3 register to 1 (i.e., select 2 12 /input frequency). note3: the wurt1-wupt0 bitys in the syscr2 must be not be change d during the oscillator warm-up event ( e.g. sleep-normal-sleep) note 4: do as follows to change the operating mode immediately after the device has warmed up from the clock stop state (e.g., from sleep mode to normal mode to sleep mode). ? warming up by hardware (1) moving from stop or sleep mode to normal mode 1) when the pll is used before moving to the next operating mode, ensu re that the lock-up bit, lupfg, in the syscr3 register has been cleared to zero and wait for five or more instructions to complete (including the instruction to check the lupfg flag). 2) when the pll is not used ? when the oscillator warm - up time (syscr2 < wupt1 : 0>) is programmed as ?01? (i . e ., 2 8 / input frequency ). before moving to the next operating mode , ensure that the lock - up bit , lupfg , in the syscr3 register has been cleared to zero and wait for fi ve or more instructions to complete . ? when the oscillator warm -up time (syscr2 < wupt1 : 0>) is programmed as ? 10? (2 14 / input frequency ) or ?11 ? (2 16 / input frequency ). before moving to the next operating mode , wait for five or more instructions to complete . (2) moving from stop or sleep mode to slow mode it is possible to move to slow mode immediately after the device has warmed up from stop or sleep mode. ? warming up by software (1) moving from slow mode to normal mode 1) when the pll is used it is possible to move to normal mode immediately after the device has warmed up. however, to move to another mode after that, ens ure that the lock-up bit, lupfg, in the syscr3 register has been cleared to zero and wait for five or more instructions to complete (including the instruction to check the lupfg flag). 2) when the pll is not used ? when the oscillator warm - up time (syscr2 < wupt1 : 0>) is programmed as ?01? (i . e ., 2 8 / input frequency ). it is possible to move to normal mode i mmediately after the device has warmed up . however , to move to another mode after that , ensure that the lock -up bit , lupfg , in the syscr3 register has been cleared to zero and wait for five or more instructions to complete . ? when the oscillator warm - up time ( syscr2 < wupt1 : 0 >) is programmed as ? 10 ? ( 2 14 / input frequency ) or ? 11 ? ( 2 16 / input frequency ). it is possible to move to normal mode immediately after the device has warmed up . however , to move to another mode after that , wait for five or more instructions to complete . (2) moving from normal mode to slow mode before moving to slow mode, ensure that the warm-up end flag (i.e., the wuef bit in the syscr0 register) is cleared and wait for five or more instructions to complete.
tmp1942cy/cz tmp1942cy/cz-22 (2) standby ( stop / sleep mode ) termination interrupts 7 6 5 4 3 2 1 0 imcga0 bit symbol emcg01 emcg00 int0en (0xffff_ee10) read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function active state setting for int0 standby termination request 00: low level 01: high level 10: falling edge 11: rising edge i n t 0 request input 0: disable 1: enable 15 14 13 12 11 10 9 8 bit symbol emcg11 emcg10 dfosc int1en read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function active state setting for int1 standby termination request 00: low level 01: high level 10: falling edge 11: rising edge i n t 1 request input 0: disable 1: enable 23 22 21 20 19 18 17 16 bit symbol emcg21 emcg20 int2en read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function active state setting for int2 standby termination request 00: low level 01: high level 10: falling edge 11: rising edge int2 request input 0: disable 1: enable 31 30 29 28 27 26 25 24 bit symbol emcg31 emcg30 int3en read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function active state setting for int3 standby termination request 00: low level 01: high level 10: falling edge 11: rising edge i n t 3 request input 0: disable 1: enable
tmp1942cy/cz tmp1942cy/cz-23 7 6 5 4 3 2 1 0 imcgb0 bit symbol emcg41 emcg40 int4en (0xffff_ee14) read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function active state setting for int4 standby termination request 00: low level 01: high level 10: falling edge 11: rising edge i n t 4 request input 0: disable 1: enable 15 14 13 12 11 10 9 8 bit symbol emcg51 emcg50 kwupen read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function these bits should always be set to 01. kwup request input 0: disable 1: enable 23 22 21 20 19 18 17 16 bit symbol emcg61 emcg60 intbcdeen read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function these bits should always be set to 01. intbcde request input 0: disable 1: enable 31 30 29 28 27 26 25 24 bit symbol emcg71 emcg70 intrtcen read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function these bits s hould always be set to 11. intrtcen request input 0: disable 1: enable
tmp1942cy/cz tmp1942cy/cz-24 note 1: when enabling an interrupt source as a means of terminating a standby mode, always set the active state for the corresponding interrupt request. note 2: when using an interrupt, always perform the following steps in order: (1) enable the input for the interrupt if the corresponding pin is also used for a general-purpose port or any other purpose. (2) set the active state for the interrupt during initialization. (3) clear the interrupt request. (4) enable the interrupt. note 3: the tmp1942 has eight interrupt sour ces (int0~int4, intrtc, intb/intc/intd/inte, and kwup0-kwupd) which can be used as a means of te rminating a standby mode. for int0 to int4, use the cg block to specify whether they are us ed to terminate a standby mode and to specify their active edge or level. for intb /intc/intd/inte and kwup 0-kwupd, use the cg block to specify whether they are used to terminate a standby mode and use intbcdest and kwupstn, respectively, to specify their active edge or level. set the active state for the corresponding interrupt source to high in the intc block. example: enable the int0 interrupt imcga0 = ?10? cg block imcga0 = ?1? (input is enabled on the falling edge.) imc0l = ?01? intc block imc0l = ?101? (a high-level interr upt is active and the interrupt level is 5.) all interrupt sources other than those which are us ed to terminate stop/sleep mode are set in the intc circuit block. note 4: among the above eight interr upt sources used to request the te rmination of a standby mode, int0 to int4 do not require settings in the cg block if they are used as normal interrupts. they still, however, require level or edge specificat ion in the intc. if intb/intc/intd/inte and kwup0-kwupd are used as normal interrupts, specify the active level or edge using intbcdest/kwupstn and specify the high level in the intc. settings in the cg are not required. intrtc always requires settings in both the cg a nd intc even if it is used as a normal interrupt. all interrupt sources other than those which are used to terminate a standby mode are set in the intc circuit block.
tmp1942cy/cz tmp1942cy/cz-25 (3) interrupt request clear register 7 6 5 4 3 2 1 0 eicrcg bit symbol icrcg2 icrcg1 icrcg0 (0xffff_ee20) read/write ? ? ? ? ? w after reset ? ? 1 0 ? ? ? ? function clear interrupt request 000: int0 100: int4 001: int1 101:kwup 010: int2 110: intb/c/d/e 011: int3 111: intrtc note : to clear any of the eight interrupt source s which are used for terminating a standby mode: (1) for kwup, use kwupclr. (2) for extended interrupts in tb/intc/intd/inte, use intflg. (3) for int0 to int4 and intrtc, perform the clearing operation twice, first in the cg block and then in the intc block. (4) for all other interrupt sources, use the intc block. 3.3.3 system clock control unit when reset , the device enters single - clock mode with the result that xen = 1 , xten = 0 and gear1 : 0 = 11 ; the system clock fsys is set to fc / 8 (= fc 1 / 8 ). ( since the pll multiplies the original oscillation frequency by 4 , fc equals to fosc 4 , where fosc is the original oscillation frequency .) for example , if the x1 and x2 pins are connected to an 8 - mhz resonator , a reset will set fsys to 4 mhz (= 8 mhz 4 1 / 8 ). to disable the system from using a pll - multiplied clock as the system clock by default , drive the plloff pin low . in this case , too , the system clock fsys will be set to fc / 8 (= fc 1 / 8 ) by a reset . however , since syscr1 < dfosc > is initialized to 0 by a reset ( so that fc = fosc 1 / 2 ), if the x1 and x2 pins are connected to a 25 - mhz resonator , fsys will be 1 . 25 mhz . also , if the device is clocked by an external oscillator and no internal resonator is connected , fc = fosc can be selected by setting syscr1 < dfocs > to 1 after a reset , so that the system clock frequen cy fsys is twice the frequency obtained with an internal resonator . (1) oscillation settling time ( switchover between normal and slow modes ) if a resonator is connected to the resonator - connecting pins , the device uses the built - in warm - up timer to check whether resonator oscillation has settled . the warm - up time can be set to suit the characteristics of the resonator using syscr2 < wupt1 : wupt0 >. the value of syscr0 < wuef > must be checked in software ( using instructions ) to determine the start and completion of the warm - up time . t able 3.3.1 shows warm - up times for m ode switching .
tmp1942cy/cz tmp1942cy/cz-26 note 1: warm-up is unnece ssary when the clock generato r uses an oscillator so that its oscillation is stable. note 2: since the warm-up timer is clocked by an oscillati ng clock, it will not be exact if the oscillation frequency fluctuates. the warm-up time should, therefore, be considered to be an approximate value. note 3: before starting the warm-up timer, firs t confirm that the pll lock-up flag is 0. note 4: the following precautions must be observed when a low-speed oscillator is being used: when a low-speed oscillator is connected to por ts pd6 and pd7, the corresponding register must be set as shown below in order to reduce the device's power consumption. (when using a resonator) set pdcr to 11 and pd to 00. (when using an external clock) set pdcr to 11 and pd to 10. table 3.3.1 warm-up time warm-up time selection syscr2 high-speed clock (fosc) low-speed clock (fs) (2 2 /oscillation frequency) 0.5 [ s] 122 [ s] (2 8 /oscillation frequency) 32 [ s] 7.8 [ms] (2 14 /oscillation frequency) 2.048 [ms] 500 [ms] (2 16 /oscillation frequency) 8.192 [ms] 2000 [ms] note: when returning from stop/sleep mode to normal or slow mode, set the warm-up time to 122 s or greater beforehand. example: if the device will return from sleep mode to slow mode, set syscr2 to 00, that is, a warm-up time of 122 s, before entering sleep mode. (2) outputting the system clock from a pin the system clock fsys or fs can be output from the p44 / scout pin to an external device . the p44 / scout pin can be set to function as the scout pin by setting the registers which relate to port 4 as follows : p4cr < p44c > = 1 and p4fc < p44f > = 1 . use syscr3 < scosel > to select which clock will be output from this pin . table 3.3.2 shows the pin state for each standby mode when the p44 / sc o ut pin is set to function as scout . table 3.3.2 scout output state for each standby mode standby mode mode scout selection normal, slow idle sleep stop = ?0? outputs fs clock. = ?1? outputs fsys clock. fixed to 0 or 1 note: this function does not guarantee a particular p hase difference (ac timing) between the internal clock and the system clock output from scout. the values calculated are for when fosc = 8 mhz and fs = 32.768 khz.
tmp1942cy/cz tmp1942cy/cz-27 (3) reducing the driving capability of oscillators if a resonator is connected to the resonator - connecting pins of an oscillator , this function can suppress oscillation noise output from the oscillator , while reducing power consumption by the oscillator . setting syscr2 < drvosch > to 1 causes the driving capability of the high - speed oscillator to degrade ( weak ). similarly , setting syscr2 < drvoscl > to 1 causes the driving capability of the low - speed oscillator to degrade ( weak ). because both bits are initialized to 0 upon a system reset , both oscillators start oscillating with their normal driving capability ( normal ) when the power is turned on . the oscillators must be placed in the normal state (< drvoscl > or < drvosch > = 0 ) when they start oscillating in any other cases, such as when stop / sleep mode is terminated . 1) reducing the driving capab ility of the high-speed oscillator 2) reducing the driving capab ility of the low-speed oscillator 3.3.4 prescaler clock control unit the internal i / o blocks ( tmra01 to tmraab , tmrb0 to tmrbd , sio0 to sio5 , sbi , and adc ) each incorporate a prescaler for dividing the clock frequency . the clock t0 fed into these prescalers is derived from the clock fperiph . fperiph is either fgear or fc ( as specified by the value of syscr1 < fpsel >) divided by either 4 or 2 , or not divided ( as specified by the value of syscr0 < prck1 : prck0 >. by default , fperiph is set to fgear and t0 to fperiph / 4 . 3.3.5 clock multiplication circuit (pll) this circuit multiplies the high - speed oscillator output clock , fosc , by 4 and outputs the result as the clock fpll . this enables the oscillator to yield a fast internal clock with a low oscillator frequency . the pll is halted by a reset . to use the pll , hold the plloff pin high when terminating a reset . note: if a reset is terminated while the plloff pin is held low, the pll will not work and the internal clock chosen will be the original oscillating clock (i.e., it will not be multiplied by 4). resonator c2 c1 oscillation enable x1 pin syscr2 f osc x2 pin resonator c2 c1 oscillation enable xt1 pin syscr2 f s xt2 pin
tmp1942cy/cz tmp1942cy/cz-28 since the pll is configur ed as an analog circuit , it requires a certain settling time ( a lock - up time ) after it has been activated , as does the oscillator . the same timer is used for both warm - up and lock - up. the lock - up time must be set using syscr3 < luptm > so that it satisfies the following relationship : lock - up time warm - up time by default , the lock - up time is 2 16 / input frequency . the lock - up timer is initiated as the high - speed oscillator starts warm - up, and the lock - up flag syscr3 < luptm > remains 1 until the pll is locked in phase and cleared to 0 upon the completion of lock - up . if, for example , the pll gets out of lock in a standby mode and control which depends on the software's execution speed , such as real - time processing , is to be performed , the software must check the lock - up flag after operation has started ( i . e ., after warm - up has been completed ) to ensure that the clock has settled , before it starts processing . on the other hand , various hardware settings and static processing , such as register and memory initialization , can be executed before the lock - up flag has been cleared . note: the lupfg bit is undefined when the plloff pin is low (the pll is not used). precautions to be observed when switching clock gear : clock gear switchover is performed by writing a value to syscr1 < gear1 : gear0 >. the clock gear is not switched immediately after the write : a execution time equal to several clock cycles is required . therefore , one or more instructions following the clock gear switchover instruction may be executed using the old clock gear value . if these instructions need to be executed using the new clock gear value , insert a dummy instruction ( which executes a write cycle only ) after the clock gear switchover instruction . when using a clock gear , make sure that the prescaler output tn in each peripheral i / o block satisfies the following relationship : tn < fsys / 2 for this purpose set the clock - related registers so that tn is slower than fsys / 2 . 3.3.6 standby control unit if the halt bit in the tx19 processor core's config register is set in normal mode , the device enters one of the standby modes - idle , sleep or stop - as determined by the contents of syscr2 < stby1 : stby0 >. if the config register's doze bit is set , the device enters idle mode regardless of the setting of syscr2 < stby1 : stby0 >. features of the idle , sleep and stop modes are described below . 1 ) idle : in this mode , only the cpu stops . in the register corresponding to each module there is an idle mode run / stop setup bit for internal i / o . this allows each module to be set independently to run or stop while the device is in idle mode . table 3.3.3 lists the idle setup registers available for each internal i / o m odul e .
tmp1942cy/cz tmp1942cy/cz-29 table 3.3.3 idle mode internal i/o setup registers internal i/o idle mode setup register tmra01 ta01run tmra23 ta23run tmra45 ta45run tmra67 ta67run tmra89 ta89run tmraab taabrun tmrb0 tb0run tmrb1 tb1run tmrb2 tb2run tmrb3 tb3run tmrb4 tb4run tmrb5 tb5run tmrb6 tb6run tmrb7 tb7run tmrb8 tb8run tmrb9 tb9run tmrba tbarun tmrbb tbbrun tmrbc tbcrun tmrbd tbdrun sio0 sc0mod1 sio1 sc1mod1 sio3 sc3mod1 sio4 sc3mod1 sio5 sc4mod1 sbi sbi0br1 a/d converter admod1 wdt wdmod note 1: in halt mode (entered when the halt bit in the config register is set), the tx19 processor core stops processor operation while maintaining the pipeline status. since it does not respond to requests for control of the bus from internal dma, it retains control of the bus. note 2: in doze mode (entered when the doze bit in the config register is set), the tx19 processor core stops processor operation while maintaining the pipeline status. in this mode, it can respond to requests for control of the bus fr om devices external to the processor core. 2 ) sleep : only the internal low - speed oscillator , timer for real - time clock , 2 - phase pulse input counter , and kwup ( dynamic pull - up ) operate . 3 ) stop : the cpu runs with the low - speed clock . the intc , timer for real - time clock , wdt , 2 - phase pulse input counter , kwup ( dynamic pull - up), pio , and ebif can operate . operation of other peripheral functions is not guaranteed . 4 ) slow : all of the internal circuits stop .
tmp1942cy/cz tmp1942cy/cz-30 (1) operating status in each mode table 3.3.4 operating status in each mode operation mode operating status normal the tx19 processor core and peripheral i/o both operate at the maximum frequency. idle (halt) the tx19 processor core, intc, timer fo r real-time clock, wdt, 2-phase pulse input counter, kwup (dynamic pull-up), pio, and ebif operate with the low-speed clock. idle (doze) processor operation stops and peripheral i/o operate s as specified. sleep processor operation stops. only the internal low-speed oscillator, timer for real-time clock, 2-phase pulse input counter, and kwup (dynamic pull-up) operate (fs). stop processor and peripheral i/o operation stops completely. (2) cg operation in each mode table 3.3.5 cg status in each operating mode clock source mode oscillator pll clock supply to peripheral i/o clock supply to the cpu normal slow u partially supplied (note) idle (halt) selectable u idle (doze) selectable u sleep fs only u timer for real-time clock, 2-phase pulse input counter, and dynamic pull-up u resonator stop u u u u normal u slow u u partially supplied(note) idle (halt) u selectable u idle (doze) u selectable u sleep u u timer for real-time clock, 2-phase pulse input counter, and dynamic pull-up u external input stop u u u u note: this includes the intc, ebif (external bus interface), i/o ports, wdt, and timer for real-time clock. (3) operation of circuit blocks in each mode ( : operating , u : idle ) table 3.3.6 circuit block operating status in each mode circuit block clock source idle (doze) idle (halt) sleep stop tx19 processor core dmac intc ebif external bus right pio da u u u u u u u u u u u (*1) u u u u u u u (*1) adc sio i2c timer counter wdt fsys u u u u u u u u u u 2-phase pulse input counter fsys/fs can be selected to run or stop for each module independently. (fs only) u dynamic pull-up fs u timer for real-time clock fs u cg  u *1: dac output is controlled with the op bit for each channel.
tmp1942cy/cz tmp1942cy/cz-31 (4) terminating a standby mode the device can be freed from a standby mode by an interrupt request or a reset . the combination of the interrupt mask register < cmask15 : 13 > setting and the current standby mode determines which interrupt source will be used to terminate the standby mode . the interrupt mask register is part of the status register in the tx19 pro cessor core's system control coprocessor ( cp0 ). details are given in table 3.3.7 . ? t e rmination by an interrupt request the operation performed when the device is released from a standby mode by an interrupt request varies according to the interrupt enable status . if the interrupt level which was set before the device entered the standby mode is greater than or equal to the value in the interrupt mask register , the processor services the requested interrupt after exiting the standby mode and then begins executing instructions starting with the one following the instruction to enter the standby mode ( i . e ., the instruction which specified the ap propriate config register bit ). if the interrupt request level is less than the value in the interrupt mask register , the processor immediately begins executing instructions starting with the one following the instruction to enter the standby mode ( i . e ., the instruction which specified the appropriat e config register bit ) without servicing the requested interrupt . ( the interrupt request flag remains 1 .) non - maskable interrupts are always serviced after standby mode has terminated , irrespective of the value of the mask register . ? termination by a reset the device can be released from any standby mode by a reset . however , after release from stop mode , a certain reset time is required for oscillator operation to settle . the reset selects a warm - up time of 2 14 / oscillation frequency . after release by a reset , the internal ram data can be retain ed in the state in which it was placed immediately before the standby mode was entered ; however , all other settings will be initialized . ( after released by an interrupt , other settings are also retained in the state in which they were placed immediately before the standby mode was entered .) table 3.3.7 standby termination source s and standby termination operation interrupt acceptance state interrupt enabled (interrupt level) > (interrupt mask) interrupt enabled (interrupt level) (interrupt mask) standby mode idle (programmable) sleep stop idle (programmable) sleep stop nmi    *1    intwdt   int0~4, intb~e kwup0~d      *1  *1 *1 *1 intrtc   int5~a  intta0~b  inttb0~d   (*2) (*2) interrupt intrx0~5, tx0~5 ints2 intad/adhp/adm    standby mode termination source reset        : after exiting the standby mode, the processor starts servicing the inte rrupt. (reset initializes the lsi.) : after exiting the standby mode, the processor begins executing instructions starting with the one following the instruction to enter the stan dby mode, without servicing the interrupt.
tmp1942cy/cz tmp1942cy/cz-32 : cannot be used to exit from a standby mode. *1: the device is actually released from the st andby mode after the warm-up time has passed. *2: only inttb2 and inttb3 can be used when 2-phase pulse input counter mode is selected. note 1: when using a level-sensitive interrupt to te rminate a standby mode, be sure to hold the level until the processor starts servicing the interrupt. if the le vel is changed before that time, the interrupt cannot be serviced properly. note 2: if the interrupts are disabled in the cpu, use the interrupt controller (intc) to disable only the interrupts other than those used for terminating st andby, before placing the device in any of the standby modes. (5) stop mode in stop mode all internal circuits , including the internal oscillator , stop operating . the pin state in stop mode varies according to the setting of syscr2 < drve >, as shown in table 3 . 3 . 10 . once released from stop mode , the device waits for a while ( until the warm - up time ends ) before starting to output the system clock ; the warm - up time is counted by the warm - up counter . this delay is to ensure that the internal oscillator settles properly . after exiting stop mode the device starts operating according to the settings of syscro < rxen , rxten , rsysck >, which select the operating mode ( normal mode or slow mode ) to be entered on exit from stop mode . these settings must be made before the instruction to enter standby mode is executed . the warm - up time is determined by the setting of syscr2 < wupt1 : wupt0 >. (6) timing of terminating stop / sleep mode 1 ) operation mode transition from normal through stop to normal when fosc = 8 mhz w-up time selection syscr2 w-up time (fc) 00(2 2 /fosc) not allowed 01(2 8 /fosc) not allowed 10(2 14 /fosc) 2.048 ms 11(2 16 /fosc) 8.192 ms fsys (high-speed clock) mode cg (high-speed clock) warm-up (w-up) high-speed clock oscillation started system clock stopped stop normal normal warm-up started warm-up finished note: must not be set to 00 or 01 resuming time requirements for the internal system.
tmp1942cy/cz tmp1942cy/cz-33 2 ) operation mode transition from normal through sleep to normal when fosc = 8 mhz w-up time selection syscr2 w-up time (fc) 01(2 2 /fosc) not allowed 01(2 8 /fosc) not allowed 10(2 14 /fosc) 2.048 ms 11(2 16 /fosc) 8.192 ms low-speed clock (fs) continues oscillation. fsys (high-speed clock) mode cg (low-speed clock) warm-up (w-up) high-speed clock oscillation started system clock stopped sleep normal normal low-speed clock (fs) continues oscillation. cg (high-speed clock) warm-up started warm-up finished note: must not be set to 00 or 01 because those settings would not satisfy the resuming time requirements for the internal system. 3 ) operation mode transition from slow through stop to slow when fs = 32.768 mhz w-up time selection syscr2 w-up time (fc) 01(2 2 /fosc) not allowed 01(2 8 /fosc) 7.8 ms 10(2 14 /fosc) 500 ms 11(2 16 /fosc) 2000 ms fsys (low-speed clock) mode cg (low-speed clock) warm-up (w-up) low-speed clock oscillation started system clock stopped stop slow slow warm-up started warm-up finished 4 ) operation mode transition from slow through sleep to slow when fs = 32.768 mhz w-up time selection syscr2 w-up time (fc) 01(2 2 /fs) 122 s 01(2 8 /fs) 7.8 ms 10(2 14 /fs) 500 ms 11(2 16 /fs) 2000 ms system clock stopped fsys (low-speed clock) mode cg (low-speed clock) warm-up (w-up) low-speed clock continues oscillation. sleep slow slow warm-up started warm-up finished note: fs continues oscillation but the warm-up time need be set. set to 00.
tmp1942cy/cz tmp1942cy/cz-34 table 3.3.8 pin states in stop mode (1/2) pins input/output = 0 = 1 ad0~ad7 input/output - - ad8~ad15 input/output - - a0~a7/a16~a23 output - output , output - output , input pu* input , , output pu* output p37 output mode input mode pu* input p40~43 output mode pu* output input mode - input p44 (scout) output mode - output p50~57 input pin - - p60~67 input pin - - input mode(key0~key7) input input p90~p91 input mode - input output mode - output input mode(int3,int4) input input input mode - input p92~97 output mode - output pa0~pa1 input mode - input output mode - output input mode(int3,int4) input input pa2~pa7 input mode - input output mode - output pa7 input mode - input output mode - output input mode(keya) input input pb1~pb4 input mode - input output mode - output input mode(intb~inte) input input pb0,pb5~pb6 input mode - input output mode - output pb7 input mode - input output mode - output input mode(keyb) input input pc0~pc5,pc7 input mode - input output mode - output pc6 input mode - input output mode - output input mode(keyb) input input pd0~pd5 input mode - input output mode - output input mode - input output mode - output pd6 (xt1)~ pd7 (xt2) xt1, xt2 - - rd wr wait busrq hwr busak w/r
tmp1942cy/cz tmp1942cy/cz-35 pins input/output = 0 = 1 pe0~pe5 input mode - input output mode - output pe6~pe7 input mode - input output mode - output input mode(int1,int2) input input pf0,pf2~pf5 input mode - input output mode - output pf1 input mode - input output mode - output input mode(keyd) input input pf6 input mode - input output mode - output input mode(int0) input input input pin input input ale output pin output low output low input pin input input bw0, bw1 input pin input input x1 input pin - - x2 output pin output high output high -: pins configured for input mode and input-onl y pins are disabled. pins configured for output mode and output-only pins assume the high-impedance state. input: the input gate is active; the input voltage must be hel d at either the high or low level to keep the input pin from floating. output: pin direction is output. pu*: programmable pull-up. because the input gate is always disabled, no overlap current flows while in high-impedance state. nmi reset
tmp1942cy/cz tmp1942cy/cz-36 3.4 interrupts interrupts are controlled by the status < cmask15 : 13> and status < iec > settings in the cp0 status register , as well as by the internal interrupt controller and the cg . for related information , refer to section 5 , ? exception handling ? in ? tx19 family architecture ?. interrupts in the tmp1942 have the following features : ? interrupts from the cpu itself ( software interrupt instructions ): 4 sources ? external interrupt pins ( nmi , int0 - inte , kwup0 - kwupd ): 30 sources ? interrupts from internal i / o : 46 sources ? vector generation for each interrupt source ? 7 interrupt priority levels for each source ? can be used to activate the dmac
tmp1942cy/cz tmp1942cy/cz-37 note 1: standby termination is performed via the cg detection ci rcuit. since its output is a high- level active signal, the intc must be set to accept a high -level active signal. note 2: the cg is bypassed for any processing other than standby te rmination. in that case, the active conditions for int0 to i nt4 must be set in the intc. note 3: intrtc requires cg settings for both standby terminat ion and other processing. the intc must be set to accept a high-level active signal. note 4: kwup and intb to intd require se ttings in each circuit block for both standby termination and other processing. the int c must be set to accept a high-level active signal. figure 3.44.1 interrupt connection diagram intnen standby termination control 8 detection circuit high or low level/edge setting high level 8 active high level 7 high or low level/edge setting disable/enable each key input kwup extended interrupts int0 4 5 key0 d intb e active high level rtc 1 1 cg other interrupts intc core high level high level 8 active high level high or low level/edge setting disable/enable input for each interrupt source
tmp1942cy/cz tmp1942cy/cz-38 (1) external interrupts int0 to int4 , intb to inte , kwup0 to kwupd , and intrtc 1 ) int0 to int4 when used to terminate a standby mode , these interrupts must have their active state set ( using imcgxx < emcgxx >) and must be enabled for input ( using imcgxx < intxen >) in the cg block . then the active state of each of the in terrupt source must be set to high ( by setting imcxx < eimxx > to 01 ) in the intc block . when these interrupts are not us ed to terminate a standby mode , set their active state in the intc block . 2 ) intb to inte when used to terminate a standby mode , these interrupts must have their active state set to high ( by setting imcgb2 < 21 : 20 > to 10 ) and must be enabled for input ( by setting imcgb2 < 16 > to 1 ) in the cg block . then the active state of each of the interrupt source must be set to high ( by setting imcxx < eimxx > to 01 ) in the intc block . use intnst for each interrupt source to set the active state and enable or disable the interrupt . when these interrupts are not used to terminate a standby mode , make necessary settings in the intc block and in tnst without having to make settings in the cg . 3 ) kw u p0 to kwupd when used to terminate a standby mode , these interrupts must have their active state set to high ( by setting imcgb1 < 21 : 20 > to 10 ) and must be enabled for input ( by setting imcgb1 < 16 > to 1 ) in the cg block . then the active state of each of the interrupt source must be set to high ( by setting imcxx < eimxx > to 01 ) in the intc block . use kwupstn for each interr upt source to set the active state and enable or disable the interrupt . when these interrupts are not used to terminate a standby mode , make necessary settings in the intc block and kwupstn without having to make settings in the cg . 4 ) intrtc regardless of whether intrtc is used to terminate a standby mode , this interrupt must have its active state set to a rising edge ( by setting imcgb3 < 29 : 28 > to 11 ) and must be enabled for input ( by setting imcgb3< 24 > to 1 ) in the cg block . then the active state of each of the interrupt source must be set to high ( by setting imcxx < eimxx > to 01 ) in the intc block .
tmp1942cy/cz tmp1942cy/cz-39 (2) external interrupts int5 to inta and internal interrupt signals ( other than intrtc ) all these interrupts must be set in the intc block . the intc resolves priority conflicts between interr upt sources and notifies the tx19 processor core of the interrupt with the highest priority . interrupt register to be set usable interrupt detection level int0 int4, intrtc* imcgx reg.in cg imcx reg.in intc when used to terminate a standby mode, the interrupt source active state must be set to high in the intc block. the active state of these interrupts must be selected in the cg. however, when these interrupts are not used to terminate a standby mode, their active state must be selected in the intc block. in both cases, low level, high level, falling edge and rising edge are all acceptable. intb inte imcgx reg.in cg imcx reg.in intc intnst the interrupt source active state must always be set to high in the intc block. when these interrupts are used to terminate a standby mode, the interrupt source active state must also be set to high in the cg. the active state of these interrupts must be selected in intnst. however, when these interrupts are not used to terminate a standby mode, settings in the cg are not necessary. in both cases, low level, high level, falling edge and rising edge are all acceptable. kwup0 d imcgx reg.in cg imcx reg.in intc kwupstn the interrupt source active state must always be set to high in the intc block. when these interrupts are used to terminate a standby mode, the interrupt source active state must also be set to high in the cg. the active state of these interrupts must be selected in kwupstn. however, when these interrupts are not used to terminate a standby mode, settings in the cg are not necessary. in both cases, low level, high level, falling edge and rising edge are all acceptable. int5 inta imcx reg.in intc low level, high level, falling edge and rising edge are all acceptable in the intc. internal i/o intdman imcx reg.in intc falling edge others imcx reg.in intc rising edge note 1: interrupt level 0 indicates that the corresponding interrupt is disabled. note 2: only a rising edge can be used for intrtc. ? example interrupt settings when int0 is used to request the termination of stop / sleep mode ( falling edge ) a . enabling the interrupt imcga0 < emcg01 : 00> = ? 10 ? : select falling edge for int0 eicrcg < icrcg2 : 0 > = ? 000 ? : clear interrupt request for int0 cg block imcga0 < int0en > = ? 1 ? : enable request input for int0 imc0l < eim11 : 10 > = ? 01 ? : select high level for int0 intclr < eiclr5 : 0 > = ? 000001 ? : clear interrupt request for int0 intc block imc0l < il12 : 10 > = ? 101 ? : set in terrup t level to 5 status < iec > = ? 1 ?, < cmask> = ? xxx ? tx19 processor core b . disabling the interrupt status < iec > = ? 0 ? tx19 processor core imc0l < il12 : 10 > = ? 000 ? : disable interrupt for int0 intclr < eiclr5 : 0 > = ? 000001 ? : clear interrupt request for int0 imcga0 < int0en > = ? 0 ? : disable request input for int0 eicrcg < icrcg2 : 0 > = ? 000 ? : clear interrupt request for int0 intc block cg block
tmp1942cy/cz tmp1942cy/cz-40 3.4.1 interrupt sources (1) reset and non - maskable interrupts : reset , nmi and intwdt ( watchdog timer interrupt ) vector address : 0xbfc0 _ 0000 ( virtual address ) (2) maskable interrupts : software and hardware interrupts vector addresses : 0xbfc0 _ 0210 ( virtual address ) to 0xbfc0 _ 0260 ( virtual address ) interrupt source vector a ddress (virtual address) reset non-maskable 0xbfc0_0000 software swi0 0xbfc0_0210 swi1 0xbfc0_0220 swi2 0xbfc0_0230 swi3 0xbfc0_0240 maskable hardware 0xbfc0_0260 note 1: when vector addresses are located in the on-chip rom, set the bev bit in the system control coprocessor (cp0) status register to 1. note 2: maskable software interrupts are generated by setting in cp0 cause register. do not confuse these software interrupts with software set, which is one of the hardware interrupt sources. the software set interrupt is generated by setting in the inte rrupt controller (int c) imc0 register to any value other than 0.
tmp1942cy/cz tmp1942cy/cz-41 table 3.44.1 hardware interrupt sources interrupt number ivr[9 : 0] interrupt source interrupt control register address 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 000 010 020 030 040 050 060 070 080 090 0a0 0b0 0c0 0d0 0e0 0f0 100 110 120 130 140 150 160 170 180 190 1a0 1b0 1c0 1d0 1e0 1f0 200 210 220 230 240 250 260 270 280 290 2a0 2b0 2c0 2d0 2e0 2f0 300 310 320 330 340 350 360 370 380 390 3a0 3b0 3c0 3d0 3e0 3f0 software set int0 pin (standby termination) int1 pin (standby termination) int2 pin (standby termination) int3 pin (standby termination) int4 pin (standby termination) kwup (standby termination) intb/c/d/e pin (standby termination) reserved reserved int5 pin int6 pin int7 pin int8 pin int9 pin int a pin intrx0: serial reception (channel 0) inttx0: serial trans mission (channel 0) intrx1: serial reception (channel 1) inttx1: serial trans mission (channel 1) ints2: serial channel 2 interrupt intrx3: serial reception (channel 3) inttx3: serial trans mission (channel 3) intadhp: highest-priority a/d conversion completed intadm: a/d conversion monitor interrupt intta0: 8-bit timer 0 intta1: 8-bit timer 1 intta2: 8-bit timer 2 intta3: 8-bit timer 3 inttb0: 16-bit timer 0 inttb1: 16-bit timer 1 intrx4: serial reception (channel 4) inttx4: serial trans mission (channel 4) intrx5: serial reception (channel 5) inttx5: serial trans mission (channel 5) reserved reserved intta4: 8-bit timer 4 intta5: 8-bit timer 5 intta6: 8-bit timer 6 intta7: 8-bit timer 7 intta8: 8-bit timer 8 intta9: 8-bit timer 9 inttaa: 8-bit timer a inttab: 8-bit timer b inttba: 16-bit timer a inttbb: 16-bit timer b inttbc: 16-bit timer c inttbd: 16-bit timer d inttb2: 16-bit timer 2 inttb3: 16-bit timer 3 inttb4: 16-bit timer 4 inttb5: 16-bit timer 5 inttb6: 16-bit timer 6 inttb7: 16-bit timer 7 inttb8: 16-bit timer 8 inttb9: 16-bit timer 9 reserved intrtc: interrupt from timer for real-time clock intad: a/d conversion completed intdma0: dma transfer completed (channel 0) intdma1: dma transfer completed (channel 1) intdma2: dma transfer completed (channel 2) intdma3: dma transfer completed (channel 3) imc0l imc0h imc1l imc1h imc2l imc2h imc3l imc3h imc4l imc4h imc5l imc5h imc6l imc6h imc7l imc7h imc8l imc8h imc9l imc9h imcal imcah imcbl imcbh imccl imcch imcdl imcdh imcel imceh imcfl imcfh 0xf f ff_e000 0xffff_e002 0xffff_e004 0xffff_e006 0xffff_e008 0xffff_e00a 0xffff_e00c 0xffff_e00e 0xffff_e010 0xffff_e012 0xffff_e014 0xffff_e016 0xffff_e018 0xffff_e01a 0xffff_e01c 0xffff_e01e 0xffff_e020 0xffff_e022 0xffff_e024 0xffff_e026 0xffff_e028 0xffff_e02a 0xffff_e02c 0xffff_e02e 0xffff_e030 0xffff_e032 0xffff_e034 0xffff_e036 0xffff_e038 0xffff_e03a 0xffff_e03c 0xffff_e03e
tmp1942cy/cz tmp1942cy/cz-42 3.4.2 interrupt detection when using interrupts to terminate a standby mode , the following settings are necessary according to the interrupt type : interrupts int0 to int4 have their active state set using the emcgxx field in the cg's internal imcgxx register , then the eimxx field in the intc's internal imcx register is set to high . extended interrupts intb to inte have their active state set to high using the emcg field in the cg's internal imcgb2 register , then the eimxx field in the intc's internal imcx register is set to high . in addition , intnst is used to set the active st ate for each interrupt source and enable / disable the interrupt source. kwup0 to kwupd have their active state set to hi gh using the emcg field in the cg's internal imcgb1 register , then the eimxx field in the intc's internal imcx register is set to high . in addition , kwupstn is used to set the active stat e for each interrupt source and enable / disable the interrupt source . the rtc interrupt has its active state set to a rising edge using the emcgxx field in the cg's internal imcgxx register , then the eimxx field in the intc's internal imcx register is set to high . other interrupts have their active state set using only the eimxx field in the intc's internal imcx register . the active state can be one of the following four : rising edge , falling edge , high level or low level . when the tmp1942 detection circuit recognizes the active st ate of an interrupt request set in this way , it notifies the processor core or the intc of the interrupt request . when the above interrupts are not used to terminate a standby mode , settings in the cg are not required : int0 to int4 require only settings in the intc , intb to inte require the same settings in the intc as for standby termination as well as setting in intnst , and kwup0 to kwupd require the sa me settings in the intc as for standby termination as well as setting in kwupstn . cancellation of interrupt signals is carried out by the interrupt handler after it has recognized the requested interrupt . intb to inte are can celed by reading intflg . interrupt signals from int0 to int4 and intrtc are cancelled by writing the appropriate value to the icrcg field in the cg's internal eicrcg register and then writing the corresponding value to the eiclr field in the intc's internal intclr register . kwup0 to kwupd are canceled by setting kw u pclr . other interrupt signals are canceled by writing the appropriate value to the eiclr field in the intc's internal intclr register . these cancellation procedures apply regardless of whether the active state is an edge or level .
tmp1942cy/cz tmp1942cy/cz-43 * the intrtc interrupt must have its active state set to a rising edge in the cg even when it is not used for standby termination. figure 3.44.2 flow for setting external interrupts note: each stage must be completed in the following sequence: set the active level, clear the interrupt request, and then enable the interrupt. ( example of setting int0 for standby termination ) imcga0 < emcg01 : 00> = ? 10 ? : select falling edge for int0 eicrcg < icrcg2 : 0 > = ? 000 ? : clear interrupt request for int0c g block imcga0 < int0en > = ? 1 ? : enable request input for int0 imc0l < eim11 : 10 > = ? 01 ? : select high level for int0 intclr < eiclr5 : 0 > = ? 000001 ? : clear interrupt request for int0 intc block imc0l < il12 : 10 > = ? 101 ? : set in terrup t level to 5 status < iec > = ? 1 ?, < cmask> = ? xxx ? tx19 processor core set intc set kwupstn or intnst set cg set intc (high level) set kwupstn or intnst set cg (high level) set intc (high level) no yes int0 a/ intrtc* intb e kwup0 d int0 4 intrtc intb e kwup0 d start standby termination interrupt? interrupt? set intc (high level) end
tmp1942cy/cz tmp1942cy/cz-44 3.4.3 resolving interrupt priority (1) seven interrupt priority levels the tmp1942 has seven interrupt priority levels ; thus for each interrupt source the priority can be set to one of seven levels . the interrupt mode control register ( imcx ) is used for setting interrupt levels . this register includes a 3 - bit level - setting field ( ilx ). the greater the value ( interrupt level ) set in imc < ilx2 : ilx0 >, the higher the interrupt priority . if the value set for an interrupt source in this field is 000 ( i . e ., the interrupt level is set to 0 ), no interrupt is generated for that interrupt source . (2) notification of the interrupt level when an interrupt occurs , the intc notifies the tx19 processor core of the priority level of the interrupt . the tx19 processor core recognizes the interrup t level by reading the il field in the cause register . if multiple interrupts ( with different priority levels ) occur simultaneously , the tx19 processor core is notified of the interrupt with the highest priority . (3) interrupt vector ( notification of interrupt source ) when an interrupt occurs , the intc also sets the vector for the source of the generated interrupt in the vector register ( ivr ). the tx19 processor core reads the vector register to determine the interrupt source . if multiple interrupts ( with the same priority level ) occur simultaneously , the tx19 processor core is notified of th e vector for the interr upt source with the smallest request number . whe n there are no interrupt sources for which an interrupt has occurred , the ivr [ 9 : 4 ] field is 0 . when it is time for the tx19 processor co re to read the vector register value , the intc notifies the processor core . the processor core sets the status < cmask > bit with the interrupt level which it reads .
tmp1942cy/cz tmp1942cy/cz-45 3.4.4 intc registers table 3.44.2 intc register map address register symbol register corresponding interrupt number 0xffff_e060 intclr interrupt request clear control all (63 ? 0) 0xffff_e040 ivr interrupt vector register all (63 ? 0) 0xffff_e03c imcf interrupt mode control register f 63 ? 60 0xffff_e038 imce interrupt mode control register e 59 ? 56 0xffff_e034 imcd interrupt mode control register d 55 ? 52 0xffff_e030 imcc interrupt mode control register c 51 ? 48 0xffff_e02c imcb interrupt mode control register b 47 ? 44 0xffff_e028 imca interrupt mode control register a 43 ? 40 0xffff_e024 imc9 interrupt mode control register 9 39 ? 36 0xffff_e020 imc8 interrupt mode control register 8 35 ? 32 0xffff_e01c imc7 interrupt mode control register 7 31 ? 28 0xffff_e018 imc6 interrupt mode control register 6 27 ? 24 0xffff_e014 imc5 interrupt mode control register 5 23 ? 20 0xffff_e010 imc4 interrupt mode control register 4 19 ? 16 0xffff_e00c imc3 interrupt mode control register 3 15 ? 12 0xffff_e008 imc2 interrupt mode control register 2 11 ? 8 0xffff_e004 imc1 interrupt mode control register 1 7 ? 4 0xffff_e000 imc0 interrupt mode control register 0 3 ? 0 interrupt vector register ( ivr ): indicates the vector for the so urce of each interrupt generated . 7 6 5 4 3 2 1 0 ivr bit symbol ivr7 ivr6 ivr5 ivr4 (0xffff_e040) read/write r after reset 0 0 0 0 0 0 0 0 function indicates the vectors for generated interrupt sources. 15 14 13 12 11 10 9 8 bit symbol i v r 9 i v r 8 read/write r/w r after reset 0 0 0 0 0 0 0 0 function indicates the vectors for generated interrupt sources. 23 22 21 20 19 18 17 16 bit symbol read/write r/w after reset 0 0 0 0 0 0 0 0 function 31 30 29 28 27 26 25 24 bit symbol read/write r/w after reset 0 0 0 0 0 0 0 0 function
tmp1942cy/cz tmp1942cy/cz-46 interrupt mode control registers : set the priority level and active state for each interrupt source and set whether the interrupt is to be used to activate the dmac . 7 6 5 4 3 2 1 0 imc0 bit symbol eim01 eim00 dm0 il02 il01 il00 (0xffff_e000) read/write r/w after reset 0 0 0 0 0 0 function sets the active state of the interrupt request. 00: low level other settings are not allowed. sets whether or not to activate the dmac. 0: not set. 1: set interrup t number 0 to activate the dmac. sets the priority level for interrupt number 0 (software set) when dm0 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm0 = 1. 000-011: 0 to 3 100-111: invalid settings 15 14 13 12 11 10 9 8 bit symbol eim11 eim10 dm1 il12 il11 il10 read/write r/w after reset 0 0 0 0 0 0 function sets the active state of the interrupt request. 00: low level 01: high level 10: falling edge 11: rising edge sets whether or not to activate the dmac. 0: not set. 1: set interrup t number 1 to activate the dmac. sets the priority level for interrupt number 1 (int0) when dm1 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm1 = 1. 000-011: 0 to 3 100-111: invalid settings 23 22 21 20 19 18 17 16 bit symbol eim21 eim20 dm2 il22 il21 il20 read/write r/w after reset 0 0 0 0 0 0 function sets the active state of the interrupt request. 00: low level 01: high level 10: falling edge 11: rising edge sets whether or not to activate the dmac. 0: not set. 1: set interrup t number 2 to activate the dmac. sets the priority level for interrupt number 2 (int1) when dm2 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm2 = 1. 000-011: 0 to 3 100-111: invalid settings 31 30 29 28 27 26 25 24 bit symbol eim31 eim30 dm3 il32 il31 il30 read/write r/w after reset 0 0 0 0 0 0 function sets the active state of the interrupt request. 00: low level 01: high level 10: falling edge 11: rising edge sets whether or not to activate the dmac. 0: not set. 1: set interrup t number 3 to activate the dmac. sets the priority level for interrupt number 3 (int2) when dm3 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm3 = 1. 000-011: 0 to 3 100-111: invalid settings note : before enabling the above interrupt requ ests, be sure to set their active state.
tmp1942cy/cz tmp1942cy/cz-47 7 6 5 4 3 2 1 0 imc1 bit symbol eim41 eim40 dm4 il42 il41 il40 (0xffff_e004) read/write r/w after reset 0 0 0 0 0 0 function sets the active state of the interrupt request. 00: low level 01: high level 10: falling edge 11: rising edge sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 4 t o activate the dmac. sets the priority level for interrupt number 4 (int3) when dm4 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm4 = 1. 000-011: 0 to 3 100-111: invalid settings 15 14 13 12 11 10 9 8 bit symbol eim51 eim50 dm5 il52 il51 il50 read/write r/w after reset 0 0 0 0 0 0 function sets the active state of the interrupt request. 00: low level 01: high level 10: falling edge 11: rising edge sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 5 t o activate the dmac. sets the priority level for interrupt number 5 (int4) when dm5 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm5 = 1. 000-011: 0 to 3 100-111: invalid settings 23 22 21 20 19 18 17 16 bit symbol eim61 eim60 dm6 il62 il61 il60 read/write r/w after reset 0 0 0 0 0 0 function sets the active state of the interrupt request. 00: low level 01: high level 10: falling edge 11: rising edge sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 6 t o activate the dmac. sets the priority level for interrupt number 6 (kwup) when dm6 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm6 = 1. 000-011: 0 to 3 100-111: invalid settings 31 30 29 28 27 26 25 24 bit symbol eim71 eim70 dm7 il72 il71 il70 read/write r/w after reset 0 0 0 0 0 0 0 function sets the active state of the interrupt request. 00: low level 01: high level 10: falling edge 11: rising edge sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 7 t o activate the dmac. sets the priority level for interrupt number 7 (intb/c/d/e) when dm7 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm7 = 1. 000-011: 0 to 3 100-111: invalid settings note : before enabling the above interrupt requ ests, be sure to set their active state.
tmp1942cy/cz tmp1942cy/cz-48 7 6 5 4 3 2 1 0 imc2 bit symbol eim81 eim80 dm8 il82 il81 il80 (0xffff_e008) read/write r/w after reset 0 0 0 0 0 0 function must be set to 00. must be set to 0. must be set to 000. 15 14 13 12 11 10 9 8 bit symbol eim91 eim90 dm9 il92 il91 il90 read/write r/w after reset 0 0 0 0 0 0 function must be set to 00. must be set to 0. must be set to 000. 23 22 21 20 19 18 17 16 bit symbol eima1 eima0 dma ila2 ila1 ila0 read/write r/w after reset 0 0 0 0 0 0 function sets the active state of the interrupt request. 00: low level 01: high level 10: falling edge 11: rising edge sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 10 to activate the dmac. sets the priority level for interrupt number 10 (int5) when dma = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dma = 1. 000-011: 0 to 3 100-111: invalid settings 31 30 29 28 27 26 25 24 bit symbol eimb1 eimb0 dmb ilb2 ilb1 ilb0 read/write r/w after reset 0 0 0 0 0 0 0 function sets the active state of the interrupt request. 00: low level 01: high level 10: falling edge 11: rising edge sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 11 to activate the dmac. sets the priority level for interrupt number 11 (int6) when dmb = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dmb = 1. 000-011: 0 to 3 100-111: invalid settings note : before enabling the above interrupt requ ests, be sure to set their active state.
tmp1942cy/cz tmp1942cy/cz-49 7 6 5 4 3 2 1 0 imc3 bit symbol eimc1 eimc0 dmc ilc2 ilc1 ilc0 (0xffff_e00c) read/write r/w after reset 0 0 0 0 0 0 function sets the active state of the interrupt request. 00: low level 01: high level 10: falling edge 11: rising edge sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 12 to activate the dmac. sets the priority level for interrupt number 12 (int7) when dmc = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dmc = 1. 000-011: 0 to 3 100-111: invalid settings 15 14 13 12 11 10 9 8 bit symbol eimd1 eimd0 dmd ild2 ild1 ild0 read/write r/w after reset 0 0 0 0 0 0 function sets the active state of the interrupt request. 00: low level 01: high level 10: falling edge 11: rising edge sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 13 to activate the dmac. sets the priority level for interrupt number 13 (int8) when dmd = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dmd = 1. 000-011: 0 to 3 100-111: invalid settings 23 22 21 20 19 18 17 16 bit symbol eime1 eime0 dme ile2 ile1 ile0 read/write r/w after reset 0 0 0 0 0 0 function sets the active state of the interrupt request. 00: low level 01: high level 10: falling edge 11: rising edge sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 14 to activate the dmac. sets the priority level for interrupt number 14 (int9) when dme = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dme = 1. 000-011: 0 to 3 100-111: invalid settings 31 30 29 28 27 26 25 24 bit symbol eimf1 eimf0 dmf ilf2 ilf1 ilf0 read/write r/w after reset 0 0 0 0 0 0 0 function sets the active state of the interrupt request. 00: low level 01: high level 10: falling edge 11: rising edge sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 15 to activate the dmac. sets the priority level for interrupt number 15 (inta) when dmf = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dmf = 1. 000-011: 0 to 3 100-111: invalid settings note : before enabling the above interrupt requ ests, be sure to set their active state.
tmp1942cy/cz tmp1942cy/cz-50 7 6 5 4 3 2 1 0 imc4 bit symbol eim101 eim100 dm10 il102 il101 il100 (0xffff_e010) read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 16 to activate the dmac. sets the priority level for interrupt number 16 (intrx0) when dm10 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm10 = 1. 000-011: 0 to 3 100-111: invalid settings 15 14 13 12 11 10 9 8 bit symbol eim111 eim110 dm11 il112 il111 il110 read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 17 to activate the dmac. sets the priority level for interrupt number 16 (inttx0) when dm11 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm11 = 1. 000-011: 0 to 3 100-111: invalid settings 23 22 21 20 19 18 17 16 bit symbol eim121 eim120 dm12 il122 il121 il120 read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 18 to activate the dmac. sets the priority level for interrupt number 18 (intrx1) when dm12 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm12 = 1. 000-011: 0 to 3 100-111: invalid settings 31 30 29 28 27 26 25 24 bit symbol eim131 eim130 dm13 il132 il131 il130 read/write r/w after reset 0 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 19 to activate the dmac. sets the priority level for interrupt number 19 (inttx1) when dm13 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm13 = 1. 000-011: 0 to 3 100-111: invalid settings note : before enabling the above interrupt requ ests, be sure to set their active state.
tmp1942cy/cz tmp1942cy/cz-51 7 6 5 4 3 2 1 0 imc5 bit symbol eim141 eim140 dm14 il142 il141 il140 (0xffff_e014) read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 20 to activate the dmac. sets the priority level for interrupt number 20 (ints2) when dm14 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm14 = 1. 000-011: 0 to 3 100-111: invalid settings 15 14 13 12 11 10 9 8 bit symbol eim151 eim150 dm15 il152 il151 il150 read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 21 to activate the dmac. sets the priority level for interrupt number 21 (intrx3) when dm15 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm15 = 1. 000-011: 0 to 3 100-111: invalid settings 23 22 21 20 19 18 17 16 bit symbol eim161 eim160 dm16 il162 il161 il160 read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 22 to activate the dmac. sets the priority level for interrupt number 22 (inttx3) when dm16 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm16 = 1. 000-011: 0 to 3 100-111: invalid settings 31 30 29 28 27 26 25 24 bit symbol eim171 eim170 dm17 il172 il171 il170 read/write r/w after reset 0 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 23 to activate the dmac. sets the priority level for interrupt number 23 (intadhp) when dm17 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm17 = 1. 000-011: 0 to 3 100-111: invalid settings note : before enabling the above interrupt requ ests, be sure to set their active state.
tmp1942cy/cz tmp1942cy/cz-52 7 6 5 4 3 2 1 0 imc6 bit symbol eim181 eim180 dm18 il182 il181 il180 (0xffff_e018) read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 24 to activate the dmac. sets the priority level for interrupt number 24 (intadm) when dm18 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm18 = 1. 000-011: 0 to 3 100-111: invalid settings 15 14 13 12 11 10 9 8 bit symbol eim191 eim190 dm19 il192 il191 il190 read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 25 to activate the dmac. sets the priority level for interrupt number 25 (intta0) when dm19 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm19 = 1. 000-011: 0 to 3 100-111: invalid settings 23 22 21 20 19 18 17 16 bit symbol eim1a1 eim1a0 dm1a il1a2 il1a1 il1a0 read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 26 to activate the dmac. sets the priority level for interrupt number 26 (intta1) when dm1a = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm1a = 1. 000-011: 0 to 3 100-111: invalid settings 31 30 29 28 27 26 25 24 bit symbol eim1b1 eim1b0 dm1b il1b2 il1b1 il1b0 read/write r/w after reset 0 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 27 to activate the dmac. sets the priority level for interrupt number 27 (intta2) when dm1b = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm1b = 1. 000-011: 0 to 3 100-111: invalid settings note : before enabling the above interrupt requ ests, be sure to set their active state.
tmp1942cy/cz tmp1942cy/cz-53 7 6 5 4 3 2 1 0 imc7 bit symbol eim1c1 eim1c0 dm1c il1c2 il1c1 il1c0 (0xffff_e01c) read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 28 to activate the dmac. sets the priority level for interrupt number 28 (intta3) when dm1c = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm1c = 1. 000-011: 0 to 3 100-111: invalid settings 15 14 13 12 11 10 9 8 bit symbol eim1d1 eim1d0 dm1d il1d2 il1d1 il1d0 read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 29 to activate the dmac. sets the priority level for interrupt number 29 (inttb0) when dm1d = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm1d = 1. 000-011: 0 to 3 100-111: invalid settings 23 22 21 20 19 18 17 16 bit symbol eim1e1 eim1e0 dm1e il1e2 il1e1 il1e0 read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 30 to activate the dmac. sets the priority level for interrupt number 30 (inttb1) when dm1e = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm1e = 1. 000-011: 0 to 3 100-111: invalid settings 31 30 29 28 27 26 25 24 bit symbol eim1f1 eim1f0 dm1f il1f2 il1f1 il1f0 read/write r/w after reset 0 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 31 to activate the dmac. sets the priority level for interrupt number 31 (intrx4) when dm1f = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm1f = 1. 000-011: 0 to 3 100-111: invalid settings note : before enabling the above interrupt requ ests, be sure to set their active state.
tmp1942cy/cz tmp1942cy/cz-54 7 6 5 4 3 2 1 0 imc8 bit symbol eim201 eim200 dm20 il202 il201 il200 (0xffff_e020) read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 32 to activate the dmac. sets the priority level for interrupt number 32 (inttx4) when dm20 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm20 = 1. 000-011: 0 to 3 100-111: invalid settings 15 14 13 12 11 10 9 8 bit symbol eim211 eim210 dm21 il212 il211 il210 read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 33 to activate the dmac. sets the priority level for interrupt number 33 (intrx5) when dm21 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm21 = 1. 000-011: 0 to 3 100-111: invalid settings 23 22 21 20 19 18 17 16 bit symbol eim221 eim220 dm22 il222 il221 il220 read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 34 to activate the dmac. sets the priority level for interrupt number 34 (inttx5) when dm22 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm22 = 1. 000-011: 0 to 3 100-111: invalid settings 31 30 29 28 27 26 25 24 bit symbol eim231 eim230 dm23 il232 il231 il230 read/write r/w after reset 0 0 0 0 0 0 0 function must be set to 00. must be set to 0. must be set to 000. note : before enabling the above interrupt requ ests, be sure to set their active state.
tmp1942cy/cz tmp1942cy/cz-55 7 6 5 4 3 2 1 0 imc9 bit symbol eim241 eim240 dm24 il242 il241 il240 (0xffff_e024) read/write r/w after reset 0 0 0 0 0 0 function must be set to 00. must be set to 0. must be set to 000. 15 14 13 12 11 10 9 8 bit symbol eim251 eim250 dm25 il252 il251 il250 read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 37 to activate the dmac. sets the priority level for interrupt number 37 (intta4) when dm25 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm25 = 1. 000-011: 0 to 3 100-111: invalid settings 23 22 21 20 19 18 17 16 bit symbol eim261 eim260 dm26 il262 il261 il260 read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 38 to activate the dmac. sets the priority level for interrupt number 38 (intta5) when dm26 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm26 = 1. 000-011: 0 to 3 100-111: invalid settings 31 30 29 28 27 26 25 24 bit symbol eim271 eim270 dm27 il272 il271 il270 read/write r/w after reset 0 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 39 to activate the dmac. sets the priority level for interrupt number 39 (intta6) when dm27 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm27 = 1. 000-011: 0 to 3 100-111: invalid settings note : before enabling the above interrupt requ ests, be sure to set their active state.
tmp1942cy/cz tmp1942cy/cz-56 7 6 5 4 3 2 1 0 imca bit symbol eim281 eim280 dm28 il282 il281 il280 (0xffff_e028) read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 40 to activate the dmac. sets the priority level for interrupt number 40 (intta7) when dm28 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm28 = 1. 000-011: 0 to 3 100-111: invalid settings 15 14 13 12 11 10 9 8 bit symbol eim291 eim290 dm29 il292 il291 il290 read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 41 to activate the dmac. sets the priority level for interrupt number 41 (intta8) when dm29 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm29 = 1. 000-011: 0 to 3 100-111: invalid settings 23 22 21 20 19 18 17 16 bit symbol eim2a1 eim2a0 dm2a il2a2 il2a1 il2a0 read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 42 to activate the dmac. sets the priority level for interrupt number 42 (intta9) when dm2a = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm2a = 1. 000-011: 0 to 3 100-111: invalid settings 31 30 29 28 27 26 25 24 bit symbol eim2b1 eim2b0 dm2b il2b2 il2b1 il2b0 read/write r/w after reset 0 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 43 to activate the dmac. sets the priority level for interrupt number 43 (inttaa) when dm2b = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm2b = 1. 000-011: 0 to 3 100-111: invalid settings note : before enabling the above interrupt requ ests, be sure to set their active state.
tmp1942cy/cz tmp1942cy/cz-57 7 6 5 4 3 2 1 0 imcb bit symbol eim2c1 eim2c0 dm2c il2c2 il2c1 il2c0 (0xffff_e02c) read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 44 to activate the dmac. sets the priority level for interrupt number 44 (inttab) when dm2c = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm2c = 1. 000-011: 0 to 3 100-111: invalid settings 15 14 13 12 11 10 9 8 bit symbol eim2d1 eim2d0 dm2d il2d2 il2d1 il2d0 read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 45 to activate the dmac. sets the priority level for interrupt number 45 (inttba) when dm2d = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm2d = 1. 000-011: 0 to 3 100-111: invalid settings 23 22 21 20 19 18 17 16 bit symbol eim2e1 eim2e0 dm2e il2e2 il2e1 il2e0 read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 46 to activate the dmac. sets the priority level for interrupt number 46 (inttbb) when dm2e = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm2e = 1. 000-011: 0 to 3 100-111: invalid settings 31 30 29 28 27 26 25 24 bit symbol eim2f1 eim2f0 dm2f il2f2 il2f1 il2f0 read/write r/w after reset 0 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 47 to activate the dmac. sets the priority level for interrupt number 47 (inttbc) when dm2f = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm2f = 1. 000-011: 0 to 3 100-111: invalid settings note : before enabling the above interrupt requ ests, be sure to set their active state.
tmp1942cy/cz tmp1942cy/cz-58 7 6 5 4 3 2 1 0 imcc bit symbol eim301 eim300 dm30 il302 il301 il300 (0xffff_e030) read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 48 to activate the dmac. sets the priority level for interrupt number 48 (inttbd) when dm30 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm30 = 1. 000-011: 0 to 3 100-111: invalid settings 15 14 13 12 11 10 9 8 bit symbol eim311 eim310 dm31 il312 il311 il310 read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 49 to activate the dmac. sets the priority level for interrupt number 49 (inttb2) when dm31 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm31 = 1. 000-011: 0 to 3 100-111: invalid settings 23 22 21 20 19 18 17 16 bit symbol eim321 eim320 dm32 il322 il321 il320 read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 50 to activate the dmac. sets the priority level for interrupt number 50 (inttb3) when dm32 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm32 = 1. 000-011: 0 to 3 100-111: invalid settings 31 30 29 28 27 26 25 24 bit symbol eim331 eim330 dm33 il332 il331 il330 read/write r/w after reset 0 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 51 to activate the dmac. sets the priority level for interrupt number 51 (inttb4) when dm33 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm33 = 1. 000-011: 0 to 3 100-111: invalid settings note : before enabling the above interrupt requ ests, be sure to set their active state.
tmp1942cy/cz tmp1942cy/cz-59 7 6 5 4 3 2 1 0 imcd bit symbol eim341 eim340 dm34 il342 il341 il340 (0xffff_e034) read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 52 to activate the dmac. sets the priority level for interrupt number 52 (inttb5) when dm34 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm34 = 1. 000-011: 0 to 3 100-111: invalid settings 15 14 13 12 11 10 9 8 bit symbol eim351 eim350 dm35 il352 il351 il350 read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 53 to activate the dmac. sets the priority level for interrupt number 53 (inttb6) when dm35 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm35 = 1. 000-011: 0 to 3 100-111: invalid settings 23 22 21 20 19 18 17 16 bit symbol eim361 eim360 dm36 il362 il361 il360 read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 54 to activate the dmac. sets the priority level for interrupt number 54 (inttb7) when dm36 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm36 = 1. 000-011: 0 to 3 100-111: invalid settings 31 30 29 28 27 26 25 24 bit symbol eim371 eim370 dm37 il372 il371 il370 read/write r/w after reset 0 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 55 to activate the dmac. sets the priority level for interrupt number 55 (inttb8) when dm37 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm37 = 1. 000-011: 0 to 3 100-111: invalid settings note : before enabling the above interrupt requ ests, be sure to set their active state.
tmp1942cy/cz tmp1942cy/cz-60 7 6 5 4 3 2 1 0 imce bit symbol eim381 eim380 dm38 il382 il381 il380 (0xffff_e038) read/write r/w after reset 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 56 to activate the dmac. sets the priority level for interrupt number 56 (inttb9) when dm38 = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm38 = 1. 000-011: 0 to 3 100-111: invalid settings 15 14 13 12 11 10 9 8 bit symbol eim391 eim390 dm39 il392 il391 il390 read/write r/w after reset 0 0 0 0 0 0 function must be set to 00. must be set to 0. must be set to 000. 23 22 21 20 19 18 17 16 bit symbol eim3a1 eim3a0 dm3a il3a2 il3a1 il3a0 read/write r/w after reset 0 0 0 0 0 0 function must be set to 01. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 58 to activate the dmac. sets the priority level for interrupt number 58 (intrtc) when dm3a = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm3a = 1. 000-011: 0 to 3 100-111: invalid settings 31 30 29 28 27 26 25 24 bit symbol eim3b1 eim3b0 dm3b il3b2 il3b1 il3b0 read/write r/w after reset 0 0 0 0 0 0 0 function must be set to 11. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 59 to activate the dmac. sets the priority level for interrupt number 59 (intad) when dm3b = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm3b = 1. 000-011: 0 to 3 100-111: invalid settings note : before enabling the above interrupt requ ests, be sure to set their active state.
tmp1942cy/cz tmp1942cy/cz-61 7 6 5 4 3 2 1 0 imcf bit symbol eim3c1 eim3c0 dm3c il3c2 il3c1 il3c0 (0xffff_e03c) read/write r/w after reset 0 0 0 0 0 0 function must be set to 10. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 60 to activate the dmac. sets the priority level for interrupt number 60 (intdma0) when dm3c = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm3c = 1. 000-011: 0 to 3 100-111: invalid settings 15 14 13 12 11 10 9 8 bit symbol eim3d1 eim3d0 dm3d il3d2 il3d1 il3d0 read/write r/w after reset 0 0 0 0 0 0 function must be set to 10. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 61 to activate the dmac. sets the priority level for interrupt number 61 (intdma1) when dm3d = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm3d = 1. 000-011: 0 to 3 100-111: invalid settings 23 22 21 20 19 18 17 16 bit symbol eim3e1 eim3e0 dm3e il3e2 il3e1 il3e0 read/write r/w after reset 0 0 0 0 0 0 function must be set to 10. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 62 to activate the dmac. sets the priority level for interrupt number 62 (intdma1) when dm3e = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm3e = 1. 000-011: 0 to 3 100-111: invalid settings 31 30 29 28 27 26 25 24 bit symbol eim3f1 eim3f0 dm3f il3f2 il3f1 il3f0 read/write r/w after reset 0 0 0 0 0 0 0 function must be set to 10. sets whether or not to activate the dmac. 0: not set. 1: set interrupt number 63 to activate the dmac. sets the priority level for interrupt number 63 (intdma2) when dm3f = 0. 000: disable interrupt. 001-111: 1 to 7 selects a dmac channel when dm3f = 1. 000-011: 0 to 3 100-111: invalid settings note : before enabling the above interrupt requ ests, be sure to set their active state.
tmp1942cy/cz tmp1942cy/cz-62 interrupt request clear register : sets the value of ivr < livr9 : livr4 > for the interrupt whose request is to be cleared . 7 6 5 4 3 2 1 0 intclr bit symbol ? ? eiclr5 eiclr4 eiclr3 eiclr2 eiclr1 eiclr0 (0xffff_e060) read/write ? ? w after reset ? ? ? ? ? ? ? ? function sets the value of ivr<9:4> for the interrupt whose request is to be cleared. note1: do not clear an interrupt request before reading the corresponding ivr value. note2: follow the steps below to disable a particular interrupt with the interrupt controller (intc). 1. globally disable the acceptance of interrupts by the core processo r by clearing the iec bit of the status register. 2. disable the desired interrupt with the intc by clearing the ilx[2:0] field of the imcxx register. 3. execute the sync instruction. 4. enable the acceptance of interrupts by the core processor by setting the iec bit of the status register. example: mtc0 r0, r31 ; _di () ; sb r0, imc** ; imc** = 0 ; sync ; _sync () ; mtc0 $sp, r31 ; _ei () ;
tmp1942cy/cz tmp1942cy/cz-63 3.5 i/o ports the tmp1942 has 108 i / o port pins . all the port pins except a few share pins with alternate functions . they can be individually programmed as general - purpose i / o or dedicated i / o for the on - chip cpu or peripherals . table 3.5.1 programmable i/o ports(1/2) port pin name # of pins direction pull resistor direction programmability alternate functions port 0 p00~p07 8 input/output bitwise ad0~ad7 port 1 p10~p17 8 input/output bitwise ad8~ad15 a8~a15 port 2 p20~p27 8 input/output bitwise a0~a7 a16~a23 p30 1 output bitwise p31 1 output bitwise p32 1 input/output pull up bitwise p33 1 input/output pull up bitwise p34 1 input/output pull up bitwise p35 1 input/output pull up bitwise p36 1 input/output pull up bitwise port 3 p37 1 input/output pull up bitwise p40 1 input/output pull up bitwise p41 1 input/output pull up bitwise p42 1 input/output pull up bitwise p43 1 input/output pull up bitwise port 4 p44 1 input/output bitwise scout port 5 p50~p57 8 input fixed an0~an7 adtrg port 6 p60~p67 8 input fixed an8~an15 key0-key7 p90 1 input/output bitwise key8 p91 1 input/output bitwise key9 p92 1 input/output bitwise tb40ut p93 1 input/output bitwise tb5out p94 1 input/output bitwise tb6out p95 1 input/output bitwise tb7in0 p96 1 input/output bitwise tb7in1 port 9 p97 1 input/output bitwise tb7out cs3 cs2 cs1 dsu r/w busak busrq wait hwr wr rd cs0
tmp1942cy/cz tmp1942cy/cz-64 table 3.5.1 programmable i/o ports(2/2) port pin name # of pins direction pull resistor direction programmability alternate functions pa0 1 input/output bitwise tb0in0 int3 pa1 1 input/output bitwise tb0in1 int4 pa2 1 input/output bitwise tb0out pa3 1 input/output bitwise tb1in0 int5 pa4 1 input/output bitwise tb1in1 int6 pa5 1 input/output bitwise tb1out pa6 1 input/output bitwise ta1out port a pa7 1 input/output bitwise ta0in keya pb0 1 input/output bitwise tb2in0 intb pb1 1 input/output bitwise tb2in1 intc pb2 1 input/output bitwise tb2out tb4in0 pb3 1 input/output bit tb3in0 intd pb4 1 input/output bit tb3in1 inte pb5 1 input/output bit tb3out tb4in1 pb6 1 input/output bit ta3out port b pb7 1 input/output bit ta2in int7 keyb pc0 1 input/output bit ta4in int8 pc1 1 input/output bit ta6in int9 pc2 1 input/output bit ta8in inta pc3 1 input/output bit ta5out pc4 1 input/output bit taain pc5 1 input/output bit ta7out pc6 1 input/output bit tb8in0 keyc port c pc7 1 input/output bit tb8in1 ta9out pd0 1 input/output bit txd0 tb9in0 pd1 1 input/output bit rxd0 tb9in1 pd2 1 input/output bit sclk0 pd3 1 input/output bit txd1 tbain0 pd4 1 input/output bit rxd1 tbain1 pd5 1 input/output bit sclk1 tabout pd6 1 input/output bit xt1 port d pd7 1 input/output bit xt2 pe0 1 input/output bit txd3 pe1 1 input/output bit rxd3 pe2 1 input/output bit sclk3 pe3 1 input/output bit txd4 pe4 1 input/output bit rxd4 pe5 1 input/output bit sclk4 pe6 1 input/output bit int1 boot port e pe7 1 input/output bit int2 intlv pf0 1 input/output bit txd5 pf1 1 input/output bit rxd5 keyd pf2 1 input/output bit sclk5 pf3 1 input/output bit sck pf4 1 input/output bit so sda pf5 1 input/output bit si scl port f pf6 1 input/output bit int0 cts0 cts1 cts3 cts4 cts5
tmp1942cy/cz tmp1942cy/cz-65 table 3.5.2 i/o port programmability (1/4) i/o register settings port pin name direction / function pn pncr pnfc pnfc2 input - 0 output - 1 port 0 p00~p07 ad0~ad7 bus - - input - 0 0 output - 1 0 ad8~ad15 bus - 0 1 port 1 p10~p17 a8~a15 bus - 1 1 input - 0 0 output - 1 0 a0~a7 bus - 0 1 port 2 p20~p27 a16~a23 bus - 1 1 output - 0 p30 - 1 output - 0 p31 - 1 input(rstup=1) 1 0 0 input(rstup=0) 0 0 0 output - 1 0 p32 - 1 1 input(rstup=1) 1 0 0 input(rstup=0) 0 0 0 output - 1 0 p33 - 0 0 input(rstup=1) 1 0 0 input(rstup=0) 0 0 0 output - 1 0 p34 - 0 1 input(rstup=1) 1 0 0 input(rstup=0) 0 0 0 output - 1 0 p35 - 1 1 input(rstup=1) 1 0 0 input(rstup=0) 0 0 0 output - 1 0 p36 - 1 1 input 1 0 port 3 p37 output 1 1 input(rstup=1) 1 0 0 input(rstup=0) 0 0 0 output - 1 0 p40 - - 1 input(rstup=1) 1 0 0 input(rstup=0) 0 0 0 output - 1 0 port 4 p41 - - 1 hwr busrq busak r/w wr wait rd cs0 cs 1
tmp1942cy/cz tmp1942cy/cz-66 table 3.5.2 i/o port programmability (2/4) i/o register settings port pin name direction / function pn pncr pnfc pnfc2 input(rstup=1) 1 0 0 input(rstup=0) 0 0 0 output - 1 0 p42 - - 1 input(rstup=1) 1 0 0 input(rstup=0) 0 0 0 output - 1 0 p43 - - 1 input 1 0 0 output 1 1 0 port 4 p44 scout - - 1 input - 0 an0~an7 - 0 port 5 p50~p57 adtrg - 1 input - 0 an8~an15 - 0 port 6 p60~p67 key0~7 - 1 input - 0 0 p90~p97 output - 1 0 p90 key8 - 0 1 p91 key9 - 0 1 p92 tb40ut - 1 1 p93 tb5out - 1 1 p94 tb6out - 1 1 p95 tb7in0 - 0 1 p96 tb7in1 - 0 1 port 9 p97 tb7out - 1 1 input - 0 0 pa0~pa7 output - 1 0 tb0in0 - 0 1 pa0 int3 - 0 1* tb0in1 - 0 1 pa1 int4 - 0 1* pa2 tb0out - 1 1 tb1in0 - 0 1 pa3 int5 - 0 - tb1in1 - 0 1 pa4 int6 - 0 - pa5 tb1out - 1 1 pa6 ta1out - 1 1 ta0in - 0 1 port a pa7 keya - 0 1 cs 2 cs 3
tmp1942cy/cz tmp1942cy/cz-67 table 3.5.2 i/o port programmability (3/4) i/o register settings port pin name direction / function pn pncr pnfc pnfc2 input - 0 0 pb0~pb7 output - 1 0 tb2in0 - 0 1 pb0 intb - 0 1* tb2in1 - 0 1 pb1 intc - 0 1* tb2out - 1 1 pb2 tb4in0 - 0 1 tb3in0 - 0 1 pb3 intd - 0 1* tb3in1 - 0 1 pb4 inte - 0 1* tb3out - 1 1 pb5 tb4in1 - 0 1 pb6 ta3out - 1 1 ta2in - 0 1 int7 - 0 - port b pb7 keyb - 0 1 input - 0 0 pc0~pc7 output - 1 0 ta4in - 0 1 pc0 int8 - 0 - ta6in - 0 1 pc1 int9 - 0 - ta8in - 0 1 pc2 inta - 0 - pc3 ta5out - 1 1 pc4 taain - 0 1 pc5 ta7out - 1 1 tb8in0 - 0 1 pc6 keyc - 0 1 tb8in1 - 0 1 port c pc7 ta9out - 1 1 input - 0 0 - pd0~pd7 output - 1 0 - txd0 - 1 1 - pd0 tb9in0 - 0 1 - rxd0 - 0 1 - pd1 tb9in1 - 0 1 - sclk0(input) - 0 1 - sclk0(output) - 1 1 - pd2 cts0 - 0 1 - txd1 - 1 1 - pd3 tbain0 - 0 1 - rxd1 - 0 1 - port d pd4 tbain1 - 0 1 -
tmp1942cy/cz tmp1942cy/cz-68 table 3.5.2 i/o port programmability (4/4) i/o register settings port pin name direction / function pn pncr pnfc pnfc2 sclk1(input) - 0 1 0 sclk1(output) - 1 1 0 cts3 - 0 1 0 pd5 tabout - 1 0 1 pd6 xt1 - - - - port d pd7 xt2 - - - - input - 0 0 pe0~pe7 output - 1 0 pe0 txd3 - 1 1 pe1 rxd3 - 0 1 sclk3(input) - 0 1 sclk3(output) - 1 1 pe2 cts3 - 0 1 pe3 txd4 - 1 1 pe4 rxd4 - 0 1 sclk4(input) - 0 1 sclk4(output) - 1 1 pe5 cts4 - 0 1 pe6 int1 - 0 1* port e pe7 int2 - 0 1* input - 0 0 pf0~pf6 output - 1 0 pf0 txd5 - 1 1 rxd5 - 0 1 pf1 keyd - 0 1 sclk5(input) - 0 1 sclk5(output) - 1 1 pf2 cts - 0 1 sck(input) - 0 1 pf3 sck(output) - 1 1 so - 1 1 pf4 sda - 1 1 si - 1 1 pf5 scl - 1 1 port f pf6 int0 - 0 1* x: don?t care pn: port n register, pncr: port n control register, pnfc: port n function register *: set this bit when using the pin for a stop mode termi nation interrupt with syscr set to 0. otherwise, the bit need not be set. note 1: hwr , w/r and p40 to p43 have their internal pullup resistors enabled when the corresponding p4fc register bit is set and when the bus is released. note 2: when p50?p57 are configured as analog ch annels of the adc, the adch[2:0] field in a/d mode control register 1 (admod1) is used to select a channel(s). note 3: when p57 is configured as adtrg , the adtrge bit in the admod1 register is used to enable and disable the external trigger input to the adc. note 4: when pd6?pd7 are configured as xt1?xt2, the syscr0 register must be programmed to enable oscillation, etc. note 5: when portd and porte and portf are c onfigured as sda and scl outputs for the sbi, the odea[7:6] field in the open-drai n enable (ode) register can be used to configure them as either push-pull or open-drain ouptuts. upon reset, the default is push-pull.
tmp1942cy/cz tmp1942cy/cz-69 3.5.1 port 0 (p00-p07) port 0 is an 8 - bit general - purpose input / output port whose bits can each be set independently for input or output . use the control register p0cr to set the port for input or output . a reset clears all bits of p0cr to 0 and puts port 0 in input mode . in add itio n to functioning as a general - purpose input / output port , this port can also function as an address/ data bus ( ad0 - ad7 ). when external memory is accessed , this port automatically functions as an address/ data bus ( ad0 - ad7 ), with all bits of p0cr cleared to 0 . figure 0.1 port 0 (p00-p07) note: the above system diagram does not represent the address/data bus function. direction control (bitwise) output latch read p0 port 0 p00-p07 (ad0-ad7) output buffer write to p0 write to p0cr reset internal data bus stop drive
tmp1942cy/cz tmp1942cy/cz-70 port 0 register 7 6 5 4 3 2 1 0 p0 bit symbol p07 p06 p05 p04 p03 p02 p01 p00 (0xffff_f000) read/write r/w after reset input mode (output latch register cleared to 0) port 0 control register 7 6 5 4 3 2 1 0 p0cr bit symbol p07c p06c p05c p04c p03c p02c p01c p00c (0xffff_f002) read/write w after reset 0 0 0 0 0 0 0 0 function 0: in 1: out (functions as ad7-ad0 when external area is accessed, with the register cleared to 0.) input/output setting for port 0 0 input 1 output figure 0.2 registers related to port 0
tmp1942cy/cz tmp1942cy/cz-71 3.5.2 port 1 (p10-p17) port 1 is an 8 - bit general - purpose input / output port whose bits can each be set independently for input or output . the control register p1cr and function register p1fc are used to set the port for input or output . a reset clears all bits of output latch p1 and all b its of p1cr and p1fc to 0 , putting port 1 in input mode . in addition to functioning as a general - purpose input / output port , this port can also function as an address/ data bus ( ad8 - ad15 ) or an address bus ( a8 - a15 ). to access external memory , set this port to an addres s bu s or address / data bus using p1cr and p1fc . figure 0.3 port 1 (p10-p17) note: the above system diagram does not represent the address/data bus function. function control (bitwise) direction control (bitwise) output latch read p1 port 1 p10-p17 (ad8-ad15/a8-a15) output buffer write to p1fc write to p1 write to p1cr reset internal data bus stop drive
tmp1942cy/cz tmp1942cy/cz-72 port 1 register 7 6 5 4 3 2 1 0 p1 bit symbol p17 p16 p15 p14 p13 p12 p11 p10 (0xffff_f001) read/write r/w after reset input mode (output latch register cleared to 0) port 1 control register 7 6 5 4 3 2 1 0 p1cr bit symbol p17c p16c p15c p14c p13c p12c p11c p10c (0xffff_f004) read/write w after reset 0 0 0 0 0 0 0 0 function << refer to p1fc. >> port 1 function register 7 6 5 4 3 2 1 0 p1fc bit symbol p17f p16f p15f p14f p13f p12f p11f p10f (0xffff_f005) read/write w after reset 0 0 0 0 0 0 0 0 function p1fc/p1cr = 00: in, 01: out, 10: ad15-8, 11: a15-8 function settings for port 1 p1fc p1cr 0 1 0 input port address/data bus (ad15-ad8) 1 output port address bus (a15-a8) figure 0.4 registers related to port 1
tmp1942cy/cz tmp1942cy/cz-73 3.5.3 port 2 (p20-p27) port 2 is an 8 - bit general - purpose input / output port whose bits can each be set independently for input or output . the control register p2cr and function register p2fc are used to set the port for input or output . a reset sets all bits of output latch p2 to 1 and clears all b its of p2cr and p2fc to 0 , putting port 2 in input mode . in addition to functioning as a general - purpose input / output port , this port can function as an address bus ( a0 - a7 or a16 - a23 ). figure 0.5 port 2 (p20-p27) direction control (bitwise) read p2 port 2 p20-p27 (a0-a7/a16-a23) output buffer write to p2 write to p2fc write to p2cr s y b a a0-7 a16-23 reset internal data bus selector selector s y b a output latch function control (bitwise) stop drive
tmp1942cy/cz tmp1942cy/cz-74 port 2 control register 7 6 5 4 3 2 1 0 p2 bit symbol p27 p26 p25 p24 p23 p22 p21 p20 (0xffff_f012) read/write r/w after reset input mode (output latch register set to 1) port 2 control register 7 6 5 4 3 2 1 0 p2cr bit symbol p27c p26c p25c p24c p23c p22c p21c p20c (0xffff_f014) read/write w after reset 0 0 0 0 0 0 0 0 function << refer to p2fc.>> port 2 function register 7 6 5 4 3 2 1 0 p2fc bit symbol p27f p26f p25f p24f p23f p22f p21f p20f (0xffff_f015) read/write w after reset 0 0 0 0 0 0 0 0 function p2fc/p2cr = 00: in, 01: out, 10: a7-0, 11: a23-16 function settings for port 2 p2cr p2fc 0 1 0 input port address bus (a7-a0) 1 output port address bus (a23-a16) figure 0.6 registers related to port 2
tmp1942cy/cz tmp1942cy/cz-75 3.5.4 port 3 (p30-p37) port 3 is an 8 - bit general - purpose input / output port whose bits can each be set independently for input or output , with the exception that p30 and p31 are output - only . the control register p3cr and function register p3fc are used to set the port for input or output . a reset sets b its p3 0 , p31 and p37 of the output latch to 1 . bits p32 to p36 are set to 1 by a reset if rstpup is high or cleared to 0 if rstpup is low. all bits of p3cr ( bits 0 and 1 not used ) and p3fc ( bits 3 and 7 not used ) are cleared to 0 by a reset , with p30 and p3 1 ou tputting a high signal and p32 to p36 placed in input mode with pull - up resistors enabled ( if rstpup is high ) or disabled ( if rstpup is low ). p37 is placed in input mode with a pull - up resistor enable d re gardless of the value of rstpup . in addition to functioning as a general - purpose input / output port , this port can also input and output the cpu's control and status signals . the rd strobe is output only when an external address area is being accessed while the p30 pi n is set for rd output (< p30f > = 1 ). similarly , the wr strobe is output only when an external address area is being accessed while the p31 pin is set for wr output (< p31f > = 1 ). p32 and p36 have their pull - up resistors enabled when busak = 0 while < p3xfc > = 1 . figure 0.7 port 3 (p30, p31) rd , wr read p3 output buffer function control (bitwise) p30 ( rd ) p31 ( wr ) write to p3 write to p3fc reset internal data bus selector s output latch b a s
tmp1942cy/cz tmp1942cy/cz-76 figure 0.8 port 3 (p32, p35, p36) read p3 output buffer function control (bitwise) direction control (bitwise) p32 ( hwr ) p35 ( busak ) p36 ( w/ r) p-ch write to p3 write to p3fc write to p3cr reset internaldatabus selector s a b stop drive s r output latch rstpup hwr , busak , w/ r reset programmable pull-up resistor
tmp1942cy/cz tmp1942cy/cz-77 figure 0.9 port 3 (p33, p34) read p3 output buffer direction control (bitwise) p33 ( wait ) p-ch write to p3 write to p3cr reset stop drive s r output latch rstpup reset programmable pull-up resistor internal wait internal data bus read p3 output buffer direction control (bitwise) p34 ( busrq ) p-ch write to p3 write to p3cr reset internal data bus stop drive s r output latch rstpup reset programmable pull-up resistor internal busrq function control (bitwise) write to p3fc
tmp1942cy/cz tmp1942cy/cz-78 figure 0.10 port 3 (p37) read p3 output buffer direction control (bitwise) p37 ( dsu ) p-ch write to p3 write to p3cr reset stop drive programmable pull-up resistor internal dsu internal data bus s output latch
tmp1942cy/cz tmp1942cy/cz-79 port 3 register 7 6 5 4 3 2 1 0 p3 bit symbol p37 p36 p35 p34 p33 p32 p31 p30 (0xffff_f018) read/write r/w after reset input mode output mode rstpup = 1 1 (pull-up) 1 (pull-up) 1 (pull-up) 1 (pull-up) 1 (pull-up) 1 (pull-up) 1 1 rstpup = 0 1 (pull-up) 0 0 0 0 0 1 1 port 3 control register 7 6 5 4 3 2 1 0 p3cr bit symbol p37c p36c p35c p34c p33c p32c ? ? (0xffff_f01a) read/write w ? ? after reset 0 0 0 0 0 0 ? ? function 0: in 1: out input/output settings for port 3 0 input 1 output port 3 function register 7 6 5 4 3 2 1 0 p3fc bit symbol ? p36f p35f p34f ? p32f p31f p30f (0xffff_f01b) read/write w after reset ? 0 0 0 ? 0 0 0 function 0: port 1: w/r 0: port 1: busak 0: port 1: busrq 0: port 1: hwr 0: port 1: wr 0: port 1: rd busrq settings p30 ( rd ) function settings p3fc 1 p3cr 0 0 1 0 outputs 0. outputs 1. busak settings 1 p3fc 1 outputs rd only during external access. p3cr 1 w/ r settings p31 ( wr ) function settings p3fc 1 p3cr 1 0 1 0 outputs 0. outputs 1. 1 outputs wr wr only during external access. hwr settings p3fc 1 p3cr 1 figure 0.11 registers related to port 3
tmp1942cy/cz tmp1942cy/cz-80 3.5.5 port 4 (p40-p44) port 4 is a 5 - bit general - purpose input / output port whose bits can each be set independently for input or output . the control register p4cr and function register p4fc are used to set the port for input or output . bits p41 to p44 of the output latch register are set to 1 by a reset if rstpup is hi gh or cleared to 0 if rstpup is low . bit p44 of the output latch register is set to 1 regardless of the value of rstpup . all bits of p4cr and p4fc are cleared to 0 by a reset , with p40 to p43 pla ced in i nput mode with pull - up resistors enabled ( if rstpup is high) or disabled ( if rstpup is low ). p44 is placed in input mode with a pull - up resistor disabled regardless of the value of rstpup . in addition to functioning as a general - purpose input / output port , p40 - p4 3 can also outp ut the chip select signals ( cs0 - cs3 ), and p44 functions as the scout pin , outputting the system clock . figure 0.12 port 4 (p40-p43) read p4 output latch function control (bitwise) direction control (bitwise) p40 ( cs0 ) p41 ( cs1 ) p42 ( cs2 ) p43 ( cs3 ) p-ch write to p4 write to p4fc write to p4cr reset internal data bus selector s a b stop drive s r output latch rstpup cs0 , cs1 , cs2 , cs3 reset programmable pull-up resistor
tmp1942cy/cz tmp1942cy/cz-81 figure 0.13 port 4 (p44) selector r function control (bitwise) r direction control (bitwise) internal data bus reset write to p4cr read p4 fs clock f sys clock p44 (scout) y s b a write to p4fc syscr3 selector y s b a selector y s b a s output latch write to p4 reset stop drive
tmp1942cy/cz tmp1942cy/cz-82 port 4 register 7 6 5 4 3 2 1 0 p4 bit symbol ? ? ? p44 p43 p42 p41 p40 (0xffff_f01e) read/write ? ? ? r/w after reset ? ? ? input mode rstpup=1 1 1 (pull-up) 1 (pull-up) 1 (pull-up) 1 (pull-up) rstpup=0 1 0 0 0 0 rstpup = 1 rstpup = 0 port 4 control register 7 6 5 4 3 2 1 0 p4cr bit symbol ? ? ? p44c p43c p42c p41c p40c (0xffff_f020) read/write ? ? ? w after reset ? ? ? 0 0 0 0 0 0: in 1: out port 4 function register 7 6 5 4 3 2 1 0 p4fc bit symbol ? ? ? p44f p43f p42f p41f p40f (0xffff_f021) read/write ? ? ? w after reset ? ? ? 0 0 0 0 0 function 0: port 0: port 1: scout 1: cs 0 port (p40) 1 cs0 0 port (p41) 1 cs1 0 port (p42) 1 cs2 0 port (p43) 1 cs3 figure 0.14 registers related to port 4
tmp1942cy/cz tmp1942cy/cz-83 3.5.6 port 5 (p50-p57) port 5 is an 8 - bit input - only port , and is shared with the a / d converter's analog input pins . p57 also functions as the a / d converter's a / d trigger input pin . figure 0.15 port 5 (p50-p57) read a/d read port 5 port 5 p50-p56 (an0-an7) internal data bus channel selector a/d converter conversion result register read a/d read port 5 port 5 p57 (an7)/ adtrg internal data bus channel selector a/d converter conversion result register function control adtrg (p57 only) write p5fc
tmp1942cy/cz tmp1942cy/cz-84 port 5 register 7 6 5 4 3 2 1 0 p5 bit symbol p57 p56 p55 p54 p53 p52 p51 p50 (0xffff_f040) read/write r after reset input mode port 5 function register 7 6 5 4 3 2 1 0 p5fc bit symbol p57f ? ? ? ? ? ? ? (0xffff_f043) read/write w ? after reset 0 ? ? ? ? ? ? ? function 0: port or a/d input 1: adtrg figure 0.16 port 5 (p50-p57) note 1: use a/d converter mode register admod4 to select a/d converter input channels and to enable a/d trigger input for p57. note 2: to use adtrg , first set to 1 and then enable trigger input in a/d converter mode register admod4. to stop using adtrg , first disable trigger input in admod4 and then clear to 0 (port).
tmp1942cy/cz tmp1942cy/cz-85 3.5.7 port 6 (p60-p67) port 6 is an 8 - bit input - only port , and is shared with the a / d converter's analog input pins and key input pins . a reset clears p6fc to 0 , placing port 6 in a / d or port input mode . writing a 1 to a bit of p6fc enables the corresponding pi n to be us ed as a key input pin . port 6 has pull - up resistors , which are enabled only for those pins for which kwupcnt < pe > is set to 1 in the key on wake - up circuit and key input is enabled in kwupstn . for details , refer to the description of th e key on wake - up function . figure 0.17 port 6 (p60-p67) port 6 register 7 6 5 4 3 2 1 0 p6 bit symbol p67 p66 p65 p64 p63 p62 p61 p60 (0xffff_f041) read/write r after reset input mode port 6 function register 7 6 5 4 3 2 1 0 p6fc bit symbol p67f p66f p65f p64f p63f p62f p61f p60f (0xffff_f045) read/write w after reset 0 function 0: port or a/d input 1: key input figure 0.18 registers related to port 6 read a/d read port 6 port 6 p60-67 (an8-15)/ key0-7 internal data bus channel selector a/d converter conversion result register function control key0-7 write p6fc keymen pe selector y a b tg dpe fs
tmp1942cy/cz tmp1942cy/cz-86 3.5.8 port 9 (p90-p97) port 9 is an 8 - bit general - purpose input / output port whose bits can each be set independently for input or output . the control register p9cr is used to set the port for input or output . a reset clears p9cr to 0 , putting port 9 in input mode . in addition to f unctioning as an in put / output port , the pins of this port can also function as various input / output pins : p90 and p91 function as key input , p92 to p94 and p97 as 16 - bit timer output , and p95 and p96 as 16- bit timer input . these functions are enabled by setting th e corres ponding bits of p9fc to 1 . a reset clears p9cr and p9fc to 0 , placing port 9 in input mode . pins p90 and p91 have pull - up resistors, which are enabled only for those pins for which kwupcnt < pe> is set to 1 in the key on wake - up circui t and key i nput is enabled in kwupstn . for details , refer to the description of the key on wake - up function . when a pin is functioning as a port pin , its pull - up resistor is disabled . when the dsu is enabled , port 9 functions as a dsu interface regardless of th e settin gs in p9cr and p9fc , so that the pins cannot be used as general - purpose port pins or peripheral function pins as described above . figure 0.19 port 9 (p90, p91) read p9 s output latch direction control (bitwise) write to p9 write to p9cr reset internal data bus stop drive function control write to p9fc output buffer keymen pe selector y a b tg dpe fs reset p90 (key8) p91 (key9) key8, 9
tmp1942cy/cz tmp1942cy/cz-87 figure 0.20 port 9 (p92-p97) p92 (tb4out) p93 (tb5out) p94 (tb6out) p97 (tb7out) reset write to p9fc read p9 write to p9 write to p9cr internal data bus function control (bitwise) direction control (bitwise) output latch a s selector b s stop drive timer f/f output tb4out: timer b4 tb5out: timer b5 tb6out: timer b6 tb7out: timer b7 s b selector a p95 (tb7in0) p96 (tb7in1) reset write to p9fc tb7in0, 1 read p9 write to p9 write to p9cr internal databus function control (bitwise) direction control (bitwise) output latch selector s s stop drive b a
tmp1942cy/cz tmp1942cy/cz-88 port 9 register 7 6 5 4 3 2 1 0 p9 bit symbol p97 p96 p95 p94 p93 p92 p91 p90 (0xffff_f04c) read/write r/w after reset input mode (output latch register set to 1) port 9 control register 7 6 5 4 3 2 1 0 p9cr bit symbol p97c p96c p95c p94c p93c p92c p91c p90c (0xffff_f04e) read/write w after reset 0 0 0 0 0 0 0 0 function 0: in 1: out input/output settings for port 9 0 input 1 output port 9 function register 7 6 5 4 3 2 1 0 p9fc bit symbol p97f p96f p95f p94f p93f p92f p91f p90f (0xffff_f04f) read/write w after reset 0 0 0 0 0 0 0 0 function 0: port 1: tb7out 0: port 1: tb7in1 0: port 1: tb7in0 0: port 1: tb6out 0: port 1: tb5out 0: port 1: tb4out 0: port 1: key9 0: port 1: key8 function corresponding p9fc bit corresponding p9cr bit port used select key8 input 1 0 p90 select key9 input 1 0 p91 select tb4out output 1 1 p92 select tb5out output 1 1 p93 select tb6out output 1 1 p94 select tb7in0 input 1 0 p95 select tb7in1 input 1 0 p96 select tb7out output 1 1 p97 figure 0.21 registers related to port 9
tmp1942cy/cz tmp1942cy/cz-89 3.5 3.5.9 port a (pa0-pa7) port a is an 8 - bit general - purpose input / output port whose bits can each be set independently for input or output . the control register pacr is used to set the port for input or output . a reset clears pacr to 0 , putting port a in input mode . in addition to functioning as an input / output port , the pins of this port can also function as various input / output pins : pa0 , pa1 , pa3 and pa4 function as 16 - bit timer input or external interrupt input , pa2 and pa5 as 16 - bit timer output , pa6 as 8 - bit timer output , and pa7 as 8 - bit timer input or key input . these functions are enabled by setting the corresponding bits of pafc to 1 . a reset clears pacr and pafc to 0 , placing port a in input mode . pa7 has a pull - up resistor , which is enabled only when kwupcnt < pe > is set to 1 in the key on wake - up circuit and key input is enabled by setting 1 in pafc . when the pin is functioning as a port pin , its pull - up resistor is disabled . figure 3.5.21 port a (pa2, pa5, pa6) reset function control (bitwise) direction control (bitwise) s output latch stop drive write to pafc tb0out tb1out ta1out write to pacr internal data bus s a selector b write to pa s b selector a timer f/f output read pa pa2 (tb0out) pa5 (tb1out) pa6 (ta1out)
tmp1942cy/cz tmp1942cy/cz-90 figure 3.5.22 port a (pa0, pa1, pa7) function control (bitwise) direction control (bitwise) s output latch stop drive write to pafc write to pacr reset internal data bus b selector a write to pa read pa pa0 (tb0in0/int3) pa1 (tb0in1/int4) s tb0in0, tb0in1 int3, int4 keya keymen pe selector y a b dpe tg fs function control (bitwise) direction control (bitwise) s output latch stop drive write to pafc write to pacr reset internal data bus b selector a write to pa read pa pa7 (ta0in/keya) s ta0in reset
tmp1942cy/cz tmp1942cy/cz-91 figure 3.5.23 port a (pa3, pa4) function control (bitwise) direction control (bitwise) s output latch stop drive write to pafc write to pacr reset internal data bus b selector a write to pa read pa pa3 (tb1in0/int5) pa4 (tb1in1/int6) s tb1in0, tb1in1 int5, int6
tmp1942cy/cz port a register 7 6 5 4 3 2 1 0 pa bit symbol pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 (0xffff_f050) read/write r/w after reset input mode (output latch register set to 1) 1 1 1 1 1 1 1 1 port a control register 7 6 5 4 3 2 1 0 pacr bit symbol pa7c pa6c pa5c pa4c pa3c pa2c pa1c pa0c (0xffff_f052) read/write w after reset 0 0 0 0 0 0 0 0 function 0: in 1: out input/output settings for port a 0 input 1 output port a function register 7 6 5 4 3 2 1 0 pafc bit symbol pa7f pa6f pa5f pa4f pa3f pa2f pa1f pa0f (0xffff_f053) read/write w after reset 0 0 0 0 0 0 0 0 function 0: port 1: ta0in keya 0: port 1: ta1out 0: port 1: tb1out 0: port 1: tb1in1 int6 0: port 1: tb1int0 int5 0: port 1: tb0out 0: port 1: tb0in1 int4 0: port 1: tb0in0 int3 function corresponding pafc bit corresponding pacr bit port used select tb0in0 input 1 0 select int3 input 1 (*1) 0 pa0 select tb0in1 input 1 0 select int4 input 1 (*1) 0 pa1 select tb0out output 1 1 pa2 select tb1in0 input 1 0 select int5 input need not be set 0 pa3 select tb1in1 input 1 0 select int6 input need not be set 0 pa4 select tb1out output 1 1 pa5 select ta1out output 1 1 pa6 select ta0in input 1 0 select keya input 1 0 pa7 (*1) set this bit when using the pin for a stop mode termination interrupt with syscr set to 0. otherwise, the bit need not be set. note: for a pin to which two input functions are assigned in addition to the port function, use the control register for each function module to specify which function is used. figure 3.5.24 registers related to port a tmp1942cy/cz-92
tmp1942cy/cz tmp1942cy/cz-93 3.5.10 port b (pb0-pb7) port b is an 8 - bit general - purpose input / output port whose bits can each be set independently for input or output . the control register pbcr is used to set the port for input or output . a reset clears pbcr to 0 , putting port b in input mode . in addition to functioning as an input / output port , the pins of this port can also function as various input / output pins : pb0 , pb1 , pb3 and pb4 function as 16 - bit timer input or external interrupt input , pb2 and pb5 as 16 - bit timer input or output , pb7 as 8 - bit timer input , interrupt input or key input . these functions are enabled by setting the corresponding bits of pbfc to 1 . a reset clears pbcr and pbfc to 0 , placing port b in input mode . pb7 has a pull - up resistor , which is enabled only when kwupcnt < pe > is set to 1 in the key on wake - up circuit and key input is enabled in kwupstn . for details , refer to the description of the key on wake - up function . when the pin is functioning as a port pin , its pull - up resistor is disabled . figure 3.5.25 port b (pb2, pb5) function control (bitwise) direction control (bitwise) s output latch stop drive write to pbfc tb2out tb3out write to pbcr reset internal data bus s a selector b write to p7 s b selector a timer f/f output read to p7 pb2 (tb2out/tb4in0) pb5 (tb3out/tb4in1) tb4in0 tb4in1
tmp1942cy/cz tmp1942cy/cz-94 figure 3.5.26 port b (pb0, pb1, pb3, pb4, pb6) function control (bitwise) direction control (bitwise) s output latch stop drive write to pbfc write to pbcr reset internal data bus b selector a write to pb read pb pb0 (tb2in0/intb) pb1 (tb2in1/intc) pb3 (tb3in0/intd) pb4 (tb3in1/inte) s tb2in0, 1 tb3in0, 1 intb, c, d, e function control (bitwise) direction control (bitwise) s output latch stop drive write to pbfc (ta3out: timer a3) write to pbcr reset internal data bus s a selector b write to pb s b selector a timer f/f output read pb pb6 (ta3out)
tmp1942cy/cz tmp1942cy/cz-95 figure 3.5.27 port b (pb7) int7 keyb keymen pe selector y a b dpe tg fs function control (bitwise) direction control (bitwise) s output latch stop drive write to pbfc write to pbcr reset internal data bus b selector a write to pb read pb pb7 (ta2in/int7/keyb) s ta2in
tmp1942cy/cz port b register 7 6 5 4 3 2 1 0 pb bit symbol pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 (0xffff_f051) read/write r/w after reset input mode (output latch register set to 1) port b control register 7 6 5 4 3 2 1 0 pbcr bit symbol pb7c pb6c pb5c pb4c pb3c pb2c pb1c pb0c (0xffff_f054) read/write w after reset 0 0 0 0 0 0 0 0 function 0: in 1: out input/output settings for port b 0 input 1 output port b function register 7 6 5 4 3 2 1 0 pbfc bit symbol pb7f pb6f pb5f pb4f pb3f pb2f pb1f pb0f (0xffff_f055) read/write w after reset 0 0 0 0 0 0 0 0 function 0:port 1:ta2in int7 keyb 0: port 1: ta3out 0: port 1: tb3out tb4in1 0: port 1: inte tb3in1 0: port 1: intd tb3in0 0: port 1: tb2out tb4in0 0: port 1: intc tb2in1 0: port 1: intb tb2in0 function corresponding pbfc bit corresponding pbcr bit port used select tb2in0 input 1 0 select intb input 1 (*1) 0 pb0 select tb2in1 input 1 0 select intc input 1 (*1) 0 pb1 select tb2out output 1 1 select tb4in0 input 0 1 pb2 select tb3in0 input 1 0 select intd input 1 (*1) 0 pb3 select tb3in1 input 1 0 select inte input 1 (*1) 0 pb4 select tb3out output 1 1 select tb4in1 input 0 1 pb5 select ta3out output 1 1 pb6 select ta2in input 1 0 select int7 input 1 0 select keyb input 1 0 pb7 (*1) set this bit when using the pin for a stop mode termination interrupt with syscr set to 0. otherwise, the bit need not be set. note: for a pin to which two or three input functions are assigned in addition to the port function, use the control register for each function module to specify which function is used. figure 3.5.28 registers related to port b tmp1942cy/cz-96
tmp1942cy/cz tmp1942cy/cz-97 3.5.11 port c (pc0-pc7) port c is an 8 - bit general - purpose input / output port whose bits can each be set independently for input or output . the control register pccr is used to set the port for input or output . a reset clears pccr to 0 , putting port c in input mode . in addition to functioning as an input / output port , the pins of this port can also function as various input / output pins : pc0 , pc1 and pc2 function as 8 - bit timer input or external interrupt input , pc3 and pc5 as 8 - bit timer output , pc6 as 16 - bit timer input or key input , pc4 as 8 - bit timer input , and pc7 as 16 - bit timer input or 8 - bit timer output . these functions are enabled by setting the corresponding bits of pcfc to 1 . a reset clears pccr and pcfc to 0 , placing port c in input mode . pc6 has a pull - up resistor , which is enabled only when kwupcnt < pe > is set to 1 in the key on wake - up circuit and key input is enabled in kwupstn . for details , refer to the description of the key on wake - up function . when the pin is functioning as a port pin , its pull - up resistor is disabled . port c becomes a 5 v input / output port when 5 v is supplied to its dedicated power supply pin dvcc52 . it becomes a vcc - based ( 3 v ) port when vcc is supplied to dvcc52 . figure 3.5.29 port c (pc3, pc5) function control (bitwise) direction control (bitwise) s output latch stop drive write to pcfc ta5out ta7out write to pccr reset internal data bus s a selector b write to pc s b selector a timer f/f output read pc pc3 (ta5out) pc5 (ta7out)
tmp1942cy/cz tmp1942cy/cz-98 figure 3.5.30 port c (pc0, pc1, pc2, pc6) function control (bitwise) direction control (bitwise) s output latch stop drive write to pcfc write to pccr reset internal data bus b selector a write to pc read pc pc0 (ta4in/int8) pc1 (ta6in/int9) pc2 (ta8in/inta) s ta4in, ta6in ta8in int8, 9, a keyc keymen pe selector y a b dpe tg fs function control (bitwise) direction control (bitwise) s output latch stop drive write to pcfc write to pccr reset internal data bus b selector a write to pc read pc pc6 (tb8in0/in0/keyc) s tb8in0 reset
tmp1942cy/cz tmp1942cy/cz-99 figure 3.5.31 port c (pc7, pc4) function control (bitwise) direction control (bitwise) s output latch stop drive write to pcfc ta9out write to pccr reset internal data bus s a selector b write to pc s b selector a timer f/f output read pc pc7 (tb8in1/ta9out) tb8in1 function control (bitwise) direction control (bitwise) s output latch stop drive write to pcfc write to pccr reset internal data bus b selector a write to pc read pc pc4 (tain) s taain
tmp1942cy/cz port c register 7 6 5 4 3 2 1 0 pc bit symbol pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 (0xffff_f058) read/write r/w after reset input mode (output latch register set to 1) port c control register 7 6 5 4 3 2 1 0 pccr bit symbol pc7c pc6c pc5c pc4c pc3c pc2c pc1c pc0c (0xffff_f05a) read/write w after reset 0 0 0 0 0 0 0 0 function 0: in 1: out port c control register 0 input 1 output port c function register 7 6 5 4 3 2 1 0 pcfc bit symbol pc7f pc6f pc5f pc4f pc3f pc2f pc1f pc0f (0xffff_f05b) read/write w after reset 0 0 0 0 0 0 0 0 function 0:port 1:tb8in ta9out 0: port 1: keyc tb8in0 0: port 1: ta7out 0: port 1: taain 0: port 1: ta5out 0: port 1: ta8in inta 0: port 1: ta6in int9 0: port 1: ta4in int8 function corresponding pcfc bit corresponding pccr bit port used select ta4in input 1 0 select int8 input need not be set 0 pc0 select ta6in input 1 0 select int9 input need not be set 0 pc1 select ta8in input 1 0 select inta input need not be set 0 pc2 select ta5out output 1 1 pc3 select taain input 1 0 pc4 select ta7out output 1 1 pc5 select tb8in0 input 1 0 select keyc input 1 0 pc6 select tb8in1 input 1 0 select ta9out output 1 1 pc7 note: for a pin to which two input functions are assigned in addition to the port function, use the control register for each function module to specify which function is used. figure 3.5.32 registers related to port c tmp1942cy/cz-100
tmp1942cy/cz tmp1942cy/cz-101 3.5.12 port d (pd0-pd7) port d is an 8 - bit general - purpose input / output port whose bits can each be set independently for input or output . the control register pdcr is used to set the port for input or output . a reset clears pdcr to 0 , putting port d in input mode . in addition to functioning as an input / output port , the pins of this port can also function as various input / output pins : pd0 and pd3 function as 16 - bit timer input or sio data output , pd1 and pd4 function as 16 - bit timer input or sio data input , pd2 as sio serial clock input / output or cts * input , and pd5 as sio serial clock input / output , cts * input , or 16 - bit timer output . pd6 and pd7 can be connected to a low - frequency oscillator . these functions are enabled by setting the corresponding bits of pdfc1 to 1 . for pd5 , however , a combination of pdfc1 and pdfc2 determines whether it is used for a port , sio , or timer . the output open - drain control register ( pdode ) can be used to set pd0 , pd2 , pd3 and pd5 to open - drain output when they are used for output . pd6 and pd7 are always open - drain output when they are used for output . a reset clears pdcr , pdfc1 and pdfc2 to 0 , placing port d in input mode . figure 3.5.33 port d (pd0, pd3) function control (bitwise) direction control (bitwise) s output latch stop drive write to pdfc txd0 txd1 write to pdcr reset internal data bus s a selector b write to pd s b selector a read pd pd0 (tb9in0/txd0) pd3 (tbain0/txd1) tb9in0 tbain0
tmp1942cy/cz tmp1942cy/cz-102 figure 3.5.34 port d (pd1, pd4, pd2) function control (bitwise) direction control (bitwise) s output latch stop drive write to pdfc write to pdcr reset internal data bus b selector a write to pd read pd pd1 (rxd0/tb9in1) pd4 ( rxd1/tbain1 ) s tb9in1, tbain1 rxd0/1 function control (bitwise) direction control (bitwise) s output latch stop drive write to pdfc sclk output write to pdcr reset internal data bus write to pd read pd pd2 (sclk0/ cts0 ) cts0 sclk0 open-drain setting possible a selector b s b selector a s
tmp1942cy/cz tmp1942cy/cz-103 figure 3.5.35 port d (pd5) note: the output mode is selected by a combinati on of pdfc1 and pdfc2. when pdfc1 = 0 and pdfc2 = 0, port output is selected. w hen pdfc1 = 1 and pdfc2 = 0, sclk output is selected. when pdfc1 = 0 and pd fc2 = 1, tabout output is selected. setting both pdfc1 and pdfc2 to 1 is not allowed. function control (bitwise) direction control (bitwise) s output latch stop drive write to pdfc sclk1 output write to pdcr reset internal data bus write to pd read pd pd5 (sclk1/ cts1 / tabout) cts1 sclk1 open-drain setting possible selector s b selector a s tabout
tmp1942cy/cz tmp1942cy/cz-104 figure 3.5.36 port d (pd6, pd7) s direction control (bitwise) write to pd write to pdcr reset internal data bus read pd pd6 b y selector a s s output latch output buffer (open-drain output) s direction control (bitwise) write to pd write to pdcr read pd b y selector a s s output latch output buffer (open-drain output) low-frequency clock pd7 enable low-frequency oscillation (on with 1)
tmp1942cy/cz port d register 7 6 5 4 3 2 1 0 pd bit symbol pd7 pd6 pd5 pd4 pd3 pd2 pd1 pd (0xffff_f059) read/write r/w after reset input mode (output latch register set to 1) port d control register 7 6 5 4 3 2 1 0 pdcr bit symbol pd7c pd6c pd5c pd4c pd3c pd2c pd1c pd0c (0xffff_f05c) read/write w after reset 1 1 0 0 0 0 0 0 function 0: in 1: out input/output settings for port d 0 input 1 output port d function register 1 7 6 5 4 3 2 1 0 pdfc1 bit symbol ? ? pd5f pd4f pd3f pd2f pd1f pd0f (0xffff_f05d) read/write w after reset ? ? 0 0 0 0 0 0 function 0: port 1: sclk1/ cts1* 0: port 1: tbain1 rxd1 0: port 1: tbain0 txd1 0: port 1: sclk0/ cts0* 0: port 1: tb9in1 rxd0 0: port 1: tb9in0 txd0 port d function register 2 7 6 5 4 3 2 1 0 pdfc2 bit symbol ? ? pd5f2 ? ? ? ? ? (0xffff_f05e) read/write ? ? w ? ? ? ? ? after reset ? ? 0 ? ? ? ? ? function 0: port 1: tabout port d open-drain control register 7 6 5 4 3 2 1 0 pdode bit symbol ? ? pdode5 ? pdode3 pdode2 ? pdode0 (0xffff_f05f) read/write w after reset ? ? 0 ? 0 0 ? 0 function 0: cmos 1: open- drain 0: cmos 1: open- drain 0: cmos 1: open- drain 0: cmos 1: open- drain tmp1942cy/cz-105
tmp1942cy/cz function corresponding pdfc1 bit corresponding pdfc2 bit corresponding pdcr bit port used select tb9in0 input 1 need not be set (no bit provided) 0 select txd0 output 1 need not be set (no bit provided) 1 pd0 select tb9in1 input 1 need not be set (no bit provided) 0 select rxd0 input 1 need not be set (no bit provided) 0 pd1 select sclk0 input 1 need not be set (no bit provided) 0 select sclk0 output 1 need not be set (no bit provided) 1 select cts0* input 1 need not be set (no bit provided) 0 pd2 select tbain0 input 1 need not be set (no bit provided) 0 select txd1 output 1 need not be set (no bit provided) 1 pd3 select tbain1 input 1 need not be set (no bit provided) 0 select rxd1 input 1 need not be set (no bit provided) 0 pd4 select sclk1 input 1 0 0 select sclk1 output 1 0 1 select cts1 input 1 0 0 select tabout output 0 1 1 pd5 note: for a pin to which two input functions are assi gned in addition to the port function, use the control register for each function module to specify which function is used. figure 3.5.37 registers related to port d tmp1942cy/cz-106
tmp1942cy/cz tmp1942cy/cz-107 3.5.13 port e (pe0-pe7) port e is an 8 - bit general - purpose input / output port whose bits can each be set independently for input or output . the control register pecr is used to set the port for input or output . a reset clears pecr to 0 , putting port e in input mode . in addition to functioning as an input / output port , the pins of this port can also function as various input / output pins : pe0 and pe3 function as sio data output , pe1 and pe4 as sio data input , pe2 and pe5 as sio clk input / output or cts * input , and pe6 and pe7 as external interrupt input . these functions are enabled by setting the corresponding bits of pefc to 1 . a reset clears pecr and pefc to 0 , placing port e in input mode . the output open - drain control register ( peode ) can be used to set pe0 , pe2 , pe3 and pe5 to open - drain output when they are used for output . figure 3.5.38 port e (pe0, pe1) function control (bitwise) direction control (bitwise) s output latch stop drive write to pefc txd3/4 write to pecr reset internal data bus write to pe read pe pe0 (txd3) pe1 (txd4) open-drain setting possible a selector b s b selector a s
tmp1942cy/cz tmp1942cy/cz-108 figure 3.5.39 port e (pe1, pe2, pe4, pe5) function control (bitwise) direction control (bitwise) s output latch stop drive write to pefc write to pecr reset internal data bus b selector a write to pe read pe pe1 (rxd3) pe4 (rxd4) s rxd1/4 function control (bitwise) direction control (bitwise) s output latch stop drive write to pefc sclk output 3 slk output 4 write to pecr reset internal data bus write to pe read pe cts3*, cts4* sclk3, sclk4 open-drain setting possible a selector b s b selector a s pe2 (sclk0/ 3cts ) pe5 (sclk1/ 4cts )
tmp1942cy/cz tmp1942cy/cz-109 figure 3.5.40 port e (pe6, pe7) function control direction control (bitwise) s output latch stop drive write to pe write to pecr reset internal data bus pe6 (int1) pe7 (int2) output buffer reset read pe int1, 2
tmp1942cy/cz port e register 7 6 5 4 3 2 1 0 pe bit symbol pe7 pe6 pe5 pe4 pe3 pe2 pe1 pe0 (0xffff_f060) read/write r/w after reset input mode (output latch register set to 1) port e control register 7 6 5 4 3 2 1 0 pecr bit symbol pe7c pe6c pe5c pe4c pe3c pe2c pe1c pe0c (0xffff_f062) read/write w after reset 0 0 0 0 0 0 0 0 function 0: in 1: out input/output settings for port e 0 input 1 output port e function register 7 6 5 4 3 2 1 0 pefc bit symbol pe7f pe6f pe5f pe4f pe3f pe2f pe1f pe0f (0xffff_f063) read/write w after reset 0 0 0 0 0 0 0 0 function 0: port 1: int2 0: port 1: int1 0: port 1: sclk4/ cts4* 0: port 1: rxd4 0: port 1:itxd4 0: port 1: sclk3/ cts3* 0: port 1: rxd3 0: port 1: txd3 port e open-drain control register 7 6 5 4 3 2 1 0 peode bit symbol ? ? peode5 ? peode3 peode2 ? peode0 (0xffff_f066) read/write ? w ? w w ? w after reset ? ? 0 ? 0 0 ? 0 function 0: cmos 1: open- drain 0: cmos 1: open- drain 0: cmos 1: open- drain 0: cmos 1: open- drain function corresponding pefc bit corresponding pecr bit port used select txd3 output 1 1 pe0 select rxd3 input 1 0 pe1 select sclk3 input 1 0 select sclk3 output 1 1 select cts3 input 1 0 pe2 select txd4 output 1 1 pe3 select rxd4 input 1 0 pe4 select sclk4 input 1 0 select sclk4 output 1 1 select cts4 input 1 0 pe5 select int1 input 1 (*1) 0 pe6 select int2 input 1 (*1) 0 pe7 *1 set this bit when using the pin for a stop mode termination interrupt with syscr set to 0. otherwise, the bit need not be set. note: for a pin to which two input functions are assigned in addition to the port function, use the control register for each function module to specify which function is used. figure 3.5.41 registers related to port e tmp1942cy/cz-110
tmp1942cy/cz tmp1942cy/cz-111 3.5.14 port f (pf0-pf6) port f is a 7 - bit general - purpose input / output port whose bits can each be set independently for input or output . the control register pfcr is used to set the port for input or output . a reset clears pfcr to 0 , putting port f in input mode . in addition to functioning as an input / output port , the pins of this port can also function as various input / output pins : pf0 functions as sio data output , pf1 as sio data input or key input , pf2 as sio clk input / output or cts * input , pf3 , pf4 and pf5 as sbi input / output , and pf6 as external interrupt input . these functions are enabled by setting the corresponding bits of pffc to 1 . a reset clears pfcr and pffc to 0 , placing port f in input mode . the output open - drain control register ( pfode ) can be used to set pf0 , pf2 , pf4 and pf5 to open - drain output when they are used for output . port f becomes a 5 v input / output port when 5 v is supplied to its dedicated power supply pin dvcc51 . it becomes a vcc - based ( 3 v ) port when vcc is supplied to dvcc51 . figure 3.5.42 port f (pf0) function control (bitwise) direction control (bitwise) s output latch stop drive write to pffc txd5 write to pfcr reset internal data bus write to pf read pf pf0 (txd5) open-drain setting possible a selector b s b selector a s
tmp1942cy/cz tmp1942cy/cz-112 figure 3.5.43 port f (pf1) keyd keymen pe selector y a b dpe tg fs function control (bitwise) direction control (bitwise) s output latch stop drive write to pffc write to pfcr reset internal data bus b selector a write to pf read pf pf1 (rxd5/keyd) s rxd5
tmp1942cy/cz tmp1942cy/cz-113 figure 3.5.44 port f (pf2, pf3) function control (bitwise) direction control (bitwise) s output latch stop drive write to pffc sclk output write to pfcr reset internal data bus write to pf read pf pf2 (clk5/ cts5 ) cts5* sclk5 open-drain setting possible a selector b s b selector a s function control (bitwise) direction control (bitwise) s output latch stop drive write to pffc sclk output write to pfcr reset internal data bus write to pf read pf pf3 (sck) a selector b s b selector a s reset sck input
tmp1942cy/cz tmp1942cy/cz-114 figure 3.5.45 port f (pf4, pf5) function control (bitwise) direction control (bitwise) s output latch stop drive write to pafc so output write to pacr reset internal data bus write to pa read pa pf4(so/sda) open-drain setting possible a selector b s b selector a s reset sda input function control (bitwise) direction control (bitwise) s output latch stop drive write to pafc write to pacr reset so output internal data bus write to pa read pa pf5 (si/scl) open-drain setting possible cde a selector b s b selector a s reset si input scl input
tmp1942cy/cz tmp1942cy/cz-115 figure 3.5.46 port f (pf6) function control direction control (bitwise) s output latch stop drive write to pf write to pfcr reset internal data bus pf6 (int0) output buffer reset read pf int0
tmp1942cy/cz port f register 7 6 5 4 3 2 1 0 pf bit symbol ? pf6 pf5 pf4 pf3 pf2 pf1 pf0 (0xffff_f061) read/write r/w after reset input mode (output latch register set to 1) port f control register 7 6 5 4 3 2 1 0 pfcr bit symbol ? pf6c pf5c pf4c pf3c pf2c pf1c pf0c (0xffff_f064) read/write w after reset 0 0 0 0 0 0 0 0 function 0: in 1: out input/output settings for port f 0 input 1 output port f function register 7 6 5 4 3 2 1 0 pefc bit symbol ? pf6f pf5f pf4f pf3f pf2f pf1f pf0f (0xffff_f065) read/write w ? after reset ? 0 0 0 0 0 0 0 function 0: port 1: int0 0: port 1: si/scia 0: port 1: so/sda 0: port 1: sok 0: port 1: solk4 cots5 0: port 1: keyd rxd5 0: port 1: txd5 port f open-drain control register 7 6 5 4 3 2 1 0 peode bit symbol ? ? pfode5 pfode4 ? pfode2 ? pfode0 (0xffff_f067) read/write ? w ? w w ? w after reset ? ? 0 ? 0 0 ? 0 function 0: cmos 1: open- drain 0: cmos 1: open- drain 0: cmos 1: open- drain 0: cmos 1: open- drain function corresponding pffc bit corresponding pfcr bit port used select txd5 output 1 1 pf0 select rxd5 input 1 0 select keyd input 1 0 pf1 select sclk4 input 1 0 select sclk4 output 1 1 select cts5 input 1 0 pf2 select sck output 1 1 select sck input 1 0 pf3 select so/sda 1 1 pf4 select si/scl 1 1 pf5 select int0 input 1(*1) 0 pf6 *1 set this bit when using the pin for a stop mode termination interrupt with syscr set to 0. otherwise, the bit need not be set. note: for a pin to which two input functions are assigned in addition to the port function, use the control register for each function module to specify which function is used. figure 3.5.47 registers related to port f tmp1942cy/cz-116
tmp1942cy/cz tmp1942cy/cz-117 3.6 external bus interface the tmp1942 contains an external bus interface function which is necessary for connecting memory or i / os which are external to the chip . this function is implemented by the external bus interface circuit ( ebif ) and the cs ( chip select )/ wait controller . the cs / wait controller specifies mapping addresses for any four addre ss spaces, and controls a wait state and data bus width ( 8 bits or 16 bits ) for these four address spaces and other external address spaces. the external bus interface circuit ( ebif ) controls timing for the external bus based on settings made with the cs / wait controller . the ebif also controls dy namic bus sizing and the arbitration of bus contention with external bus masters . ? wait function can be set individually for each block . ? a wait state of up to 7 clock cycles can be automatically inserted . ? wait states can be inserted from the wait pin . ? data bus width the bus width can be independently selected as 8 bits or 16 bits for each block . ? read recovery cycle when a external bus cycle is immediately followed by a next external bus cycle, up to two dummy clock cycles can be inserted . insertion of the d ummy cycle ( s) can be set individually for each block . ? control of ale width the ale width can be set to 0 . 5 or 1 . 5 clock cycles. the set ale width applies to all blocks in common . ? arbitration of bus contention
tmp1942cy/cz tmp1942-118 3.6.1 address and data pins (1) setting address and data pins for external memory connections , port 0 ( ad0 - ad7 ), port 1 ( ad8 - ad15 / a8 - a15 ) and port 2 ( a16 - a23 / a0 - a7 ) pins can be used as the address bus and the data bus . one of the following four bus configurations can be selected by setting up th e port registers . (1) (2) (3) (4) number of address bus lines max.24 (~16 mb) max.24 (~16 mb) max.16 (~64 kb) max.8 (~256 b) number of data bus lines 8 16 8 16 number of multiplexed address/data bus lines 8 16 0 0 port 0 ad0 ~ ad7 ad0 ~ ad7 ad0 ~ ad7 ad0 ~ ad7 port 1 a8 ~ a15 ad8 ~ ad15 a8 ~ a15 ad8 ~ ad15 port function port 2 a16 ~ a23 a16 ~ a23 a0 ~ a7 a0 ~ a7 timing diagram note 1: even for cases (3) and (4), addresses are output because the data bus pins are shared with the address bus. note 2: ports 0 to 2 are set for input after a re set, and do not function as address or data bus pins. note 3: any one of (1) to (4) can be selected by setting the p1cr, p1fc, p2cr and p2fc registers as desired. (2) address hold when an internal area is accessed when an internal area is accessed , the address bus retains the previous address which was output by the external area device ; thus the address does not change . in addition , the address/ data bus is placed in high - impedance state. a23~8 a23~8 a7~0 d7~0 ad7~0 ale rd a23~16 ad15~0 ale rd a23~16 a15~0 d15~0 (note1) a15~0 ad7~0 ale rd a15~0 a7~0 d7~0 a7~0 ad15~0 ale rd a7~0 a15~0 d15~0 (note1)
tmp1942cy/cz tmp1942cy/cz-119 3.6.2 external bus operation this section explains various bus timings . in the following timing diagrams , the address bus is chosen to be a23 - a16 and the address / data bus is chosen to be ad15 - ad0 . (1) basic bus operation external bus cycles in the tmp1942 essentially consist of three clock cycles . a wait state can be in serted , as will be explained later . the basic clock for external bus cycles is the same as the internal system clock . figure 3.6.1 shows a read bus timing . figure 3.6.2 shows a write bus timing . during internal access, the address bus does not change , as shown in the diagram , nor doe s ale output a latch pulse . the address / data bus is placed in high - impedance state, and neither rd and wr nor other control signals are asserted . figure 3.6.1 read operation timing diagram figure 3.6.2 write operation timing diagram note: fsys expresses one period of share of system clock. a [23 : 16] a d [15 : 0] a le rd external access internal access enter hi-z state does not output ale does not output rd holds upper address adr data tsys tsys a [23 : 16] a d [15 : 0] a le wr external area internal area enter hi-z state does not output ale does not output wr holds upper address adr data
tmp1942cy/cz tmp1942-120 (2) wait timing wait cycles can be inserted individually for each block by using the cs / wait controller . the following two types of wait insertion can be used : a . automatic wait insertion of up to 7 clock cycles b . wait insertion from wait pin note : ? please set the number of wait as ?+ 1 ? when you use = long and busrq the ale width .? timing diagrams with a wait state inserted are shown below . figure 3.6.3 read operation timing diagra m (with 0 wait cycles and 1 wait cycle) figure 3.6.4 read operation timing diagram (1+n wait cycles, n = 1) a [23 : 16] a d [15 : 0] a le rd upper address upper address adr data adr data 0 wait 1 wait wait tsys a [23 : 16] a d [15 : 0] a le rd upper address upper address adr data data wait 0 wait (1+ n wait, n = 1) wait tsys adr
tmp1942cy/cz tmp1942cy/cz-121 figure 3.6.5 write operation timing diagra m (with 0 wait cycles and 1 wait cycle) figure 3.6.6 write operation timing diagram (1+n wait cycles, n = 1) a [23 : 16] a d [15 : 0] a le wr upper address upper address adr data adr data 0 wait 1 wait wait tsys a [23 : 16] a d [15 : 0] a le wr upper address upper address adr data data 0 wait (1+ n wait, n = 1) wait wait tsys adr
tmp1942cy/cz tmp1942-122 (3) ale assertion time the ale assertion time can be selected as either 0 . 5 or 1 . 5 clock cycles. the bit for setting this assertion time is provided in the system clock control register . the default assertion time is 1 . 5 clock cycles. the assertion time cannot be set individually fo r blocks in the external area ; it applies universally to the entire external address space . note : ? please set the number of wait as ?+ 1 ? when you use = long and busrq the ale width .? figure 3.6.7 ale assertion time figure 3.6.8 shows read operation timing with an ale assertion time of 0 . 5 clock cycles and th at with an ale assertion time of 1 . 5 clock cycles. figure 3.6.8 read operation timing diagram (with ale asserted for 0.5 and 1.5 clock cycles) a le (alesel = 0) a d [15 : 0] (alesel = 1) a d [15 : 0] 0.5 clock cycle 1.5 clock cycles tsys a [23 : 16] a d [15 : 0] a le rd upper address upper address adr data adr data ale 0.5 clock cycle ale 1.5 clock cycles tsys
tmp1942cy/cz tmp1942cy/cz-123 (4) read recovery time when an external access occurs after reading from an external area , a dummy cycle can be inserted to create a recovery time . dummy cycles can only be inserted when the immediately preceding cycle is a read cycle . external read followed by external read : can be inserted external read fo llowed by external write : can be inserted external write followed by external access: cannot be inserted the number of dummy cycles can be specified independently for each block as one clock cycle or two clock cycles. use the cs / wait controller to set the number of clock cycles. figure 3.6.9 rea d recovery time as shown above , by adding two dummy clock cycles, a sufficient time from the rise of rd to the output of the next address can be secured even when the device is operating at a fast clock speed . figure 3.6.10 shows a bus timing diagram where one and two dummy clock cycles are inserted . figure 3.6.10 read operation timing di agram (with dummy cycles inserted) read data rd a d [15 : 0] a le a le next adr two clock cycles added a d [15 : 0] read data next adr tsys adr a le a d [15 : 0] data adr a [23 : 16] dummy cycle (1 clock cycle) dummy cycles (2 clock cycles) rd tsys dummy upper address data dummy
tmp1942cy/cz tmp1942-124 3.6.3 bus arbitration the tmp1942 allows external bus masters to be connected to the chip . two signals busrq and busak are used to arbitrate contention for bus control between the processor and external bus masters . external bus masters can only gain control of buses external to the tmp1942 . external bus masters cannot gain control of the device's internal bus . (1) access range for external bus masters external bus masters can on ly gain control of buses external to the tmp1942 . external bus masters cannot gain control of the device's internal bus ( g - bus ). therefore , external bus masters cannot access the device's internal memory and internal i / o blocks . contention for control of the external bus is arbitrated by the external bus in terface circuit ( ebif ); hence the cpu and the internal dmac are not involved in bus arbitration . even when an external bus master has control of the external bus , the cpu and the internal dmac can access the internal rom and ram and the internal registers . on the other hand , when the cpu or th e internal dmac attempts to access external memory while an external bus master has control of the external bus , the cpu or the internal dmac is kept waiting until the external bus master finishes control of the external bus . therefore , if busrq remains asserted for an excessive period of time , the tmp1942 may get locked . (2) gaining control of the bus an external bus master requests control of the bus from the tmp1942 by asserting the busrq signal . the tmp1942 samples the busrq signal during a break in the external bus cycles on the internal bus ( g - bus ) to determine whether or not to grant control of the bus . to give control of the bus to the external bus master , it asserts the busak signal . at the same time , it places the address bus , data bus and bus control signals in high - impedance state. if the data size to be loaded or stored is larger than the width of the bus for the external memory , multiple bus cycles may occur for a single data tran sfer ( bus sizing). in such a case , a break in the external bus cycles will occur when the last bus cycle has finished . the tmp1942 allows the insertion of dummy cycles when external access continues for successive bus cycles. even in this case it is only when a break in th e external bus cycles occurs on the internal bus ( g - bus ) that a request for bus control is accepted . during a dummy cycle the next external bus cycle is already activated on the internal bus , so that if the busrq signal is asserted during a dummy cycle , the bus will only be released after the next bus cycle has been completed . make sure the busrq signal remains asserted until control of the bus has been finished . figure 3.6.11 shows a timing sequence in which control of the bus is gained by an external bus master . note : ? please set the number of wait as ?+ 1 ? when you use = long and busrq the ale width .?
tmp1942cy/cz tmp1942cy/cz-125 figure 3.6.11 timing at which control of the bus is gained (3) relinquishing control of the bus an external bus master relinquishes control of the bus in the following case : ? when it no longer requires control of the bus 1 ) relinquishing control of the bus when an external bus master no longer requires control of the bus . when th e external bus master no longer needs the control of the bus which it gained , it deasserts the busrq signal to return control of the bus to the tmp1942 . figure 3.6.12 shows a timing sequence in which the bus is released because the external bus master no longer requires control of it. figure 3.6.12 timing at which control of the bus is relinquished (1) (2) (3) internal address external address busrq busak tmp1942 external access tmp1942 external access external bus master cycle tmp1942 external access tsys tmp1942 external access (1) busrq is high. (2) the tmp1942 recognizes that busrq has been pulled low and releases the bus when the bus cycle has been completed. (3) the tmp1942 asserts busak upon completion of the bus cycle. the external bus master recognizes that busak has been asserted low and gains control of the bus, thereby initiating its bus operation. internal address external address busrq busak tmp1942 external access tmp1942 external access tmp1942 external access external bus master cycle tmp1942 external access (1) tsys (2)(3) (1) the external bus master has control of the bus. (2) because the external bus master no longer requires control of the bus, it deasserts busrq . (3) the tmp1942 recognizes that busrq has reverted to high and responds by deasserting busak .
tmp1942cy/cz tmp1942-126 (4) bus release timings note: gaddr indicates the address on the g-bus. ad (addr) indicates the address on the address/data bus. addr indicates the address on the address bus. gaddr a d (addr) a dd r busrq busrq asserted during internal access (no external wait) busak internal external 2 external 1 exte r -nal 1 external 2 external 2 tsys gaddr a d (addr) a dd r busrq busrq asserted during internal access (no external wait) busak internal external 2 external 1 external 2 external 2 external 1 gaddr a d (addr) a dd r busrq busrq asserted during internal access (no external wait) busak internal external 2 external 1 external 1 external 2 external 2
tmp1942cy/cz tmp1942cy/cz-127 gaddr a d (addr) a dd r busrq busrq asserted during external access, foll owed by internal access (no external wait) busak external 1 external 2 internal external 2 external 1 external 1 external 1 external 2 gaddr a d (addr) a dd r busrq busrq asserted during external access, foll owed by internal access (no external wait) busak external 1 external 2 internal external 2 external 1 external 1 external 1 external 2 external 3 gaddr a d (addr) a dd r busrq busrq asserted during external access, foll owed by external access (no external wait) external 1 busak external 2 external 1 external 3 external 2 external 3 external 2 external 1 external 1 external 3
tmp1942cy/cz tmp1942-128 gaddr a d (addr) a dd r busrq bus sizing applied (no external wait) external 1 busak external 1 external 2 external 1a external 1b external 2 external 1a external 2 external 1b external 1b gaddr a d (addr) a dd r busrq bus sizing applied (no external wait) busak external 1a external 1d external 1c external 1 external 1a external 1b external 1c external 1d
tmp1942cy/cz tmp1942cy/cz-129 gaddr a d (addr) a dd r busrq busrq asserted during external access, followed by internal access (no exter nal wait, 1 idle cycle) busak idle external 1 external 2 internal external 1 external 2 external 2 external 1 external 1 gaddr a d (addr) a dd r busrq busrq asserted during external access, followed by internal access (no exter nal wait, 1 idle cycle) busak idle external 1 external 2 internal external 1 external 2 external 1 external 1 external 2 external 3 gaddr a d (addr) a dd r busrq busrq asserted during external access, followed by external access (no external wait, 1 idle cycle) busak external 3 idle external 1 external 3 external 2 external 2 external 1 external 1 external 1 external 2 external 3
tmp1942cy/cz tmp1942-130 3.7 chip select/wait controller the tmp1942 supports direct connections to external devices ( i / o devices , rom and sram ). the tmp1942 provides four programmable chip select signals . programmable features include variable block sizes , data bus width , wait state insertion , and dummy cycle insertion for back - to - back bus cycles. 0cs - 3cs ( multiplexed with p40 - p43 ) are the chip select output pins for the cs0 - cs3 address ranges . these chip select signals are generated when the cpu or on - chip dmac issues an address within the programmed ranges . the p40 - p43 pins must be configured as cs0 - cs3 by programming the port 4 c ontrol ( p4cr ) register and the port 4 function ( p4fc ) register . chip select address ranges are defined in terms of a base address and an address mask . there is a base / mask address ( bman ) register for each of the four chip select signals , where n is a number from 0 to 3 . there is also a set of th ree chip select / wait control registers , b01cs , b23cs and bexcs , each of which consists of a master enable bit , a data bus width bit , a wait state field and a dummy cycle field . external memory devices can also use the wait pin to insert wait states and consequently prolong read and write bus cycles. 3.7.1 programming chip select ranges each of the four chip select address ranges is defined in the bman register . the basic chip select model allows one of the chip select output signals ( 0cs - 3cs ) to assert when an address on the address bus falls within a particular programmed range . the b01cs register defines specific operations for cs0 and cs1 , and the b23cs register defines specific operations for cs2 and cs3 ( see section 3 . 7 . 2 ). (1) base/mask address registers the organizations of the bman registers are shown in fig.3.7.1 and fig. 3.7.2. the base address (ban) field specifies the starting address for a ch ip select. any set bit in the address mask field ( man ) masks the corresponding base address bit. the address mask field determines the block size of a particular chip select line . the address is compared on every bus cycle. / base address the base address ( ban ) field specifies the upper 16 bits ( a31 - a16 ) of the starting addres s for a chip select . the lower 16 bits ( a15 - a0 ) are assumed to be zero . thus , the base address is any multiple of 64 kbytes starting at 0x0000 _ 0000 . figure 3 . 7 . 3 shows the relationships between starting addresses and the bman values . / address mask the address mask ( man ) field de fines whether any particular bits of the address should be compared or masked . any set bit masks the corresponding base address bit . the address compare logic uses only the address bits that are not masked ( i . e ., mask bit cleared to 0 ) to detect an address match . address bits that can be ma sked ( i . e ., supported block sizes ) differ for the four chip select spaces as follows : cs0 and cs1 spaces : a29 - a14 cs2 and cs3 spaces : a30 - a15 note : use physical addresses in the bman registers .
tmp1942cy/cz tmp1942cy/cz-131 base / mask address registers bma0 ( 0xffff _ e400 ) to bma3 ( 0xffff _ e40c ) 7 6 5 4 3 2 1 0 bma0 bit symbol ma0 (0xffff_e400) read/write r/w after reset 1 1 1 1 1 1 1 1 function sets the size of the cs0 s pace. 0: used for comparing addresses 15 14 13 12 11 10 9 8 bit symbol ma0 read/write r/w after reset 0 0 0 0 0 0 1 1 function must always be set to 0. 23 22 21 20 19 18 17 16 bit symbol ba0 read/write r/w after reset 0 0 0 0 0 0 0 0 function sets a23-a16 for the start address. 31 30 29 28 27 26 25 24 bit symbol ba0 read/write r/w after reset 0 0 0 0 0 0 0 0 function sets a31-a24 for the start address. 7 6 5 4 3 2 1 0 bma1 bit symbol ma1 (0xffff_e404) read/write r/w after reset 1 1 1 1 1 1 1 1 function sets the size of the cs1 space. 0: used for comparing addresses 15 14 13 12 11 10 9 8 bit symbol ma1 read/write r/w after reset 0 0 0 0 0 0 1 1 function must always be set to 0. 23 22 21 20 19 18 17 16 bit symbol ba1 read/write r/w after reset 0 0 0 0 0 0 0 0 function sets a23-a16 for the start address. 31 30 29 28 27 26 25 24 bit symbol ba1 read/write r/w after reset 0 0 0 0 0 0 0 0 function sets a31-a24 for the start address. note: bits 10-15 in bma0 and bma1 must always be set to 0. this is because, although the cs0 and cs1 spaces can have a size of 16 kb to 1 gb, the tmp1942?s external address space is limited to 16 mb, which requires setting bits 10-15 to 0 so as not to mask the a24-a29 address bits. figure 3.7.1 base/mask addres s registers (bma0 and bma1)
tmp1942cy/cz tmp1942-132 7 6 5 4 3 2 1 0 bma2 bit symbol ma2 (0xffff_e408) read/write r/w after reset 1 1 1 1 1 1 1 1 function sets the size of the cs2 s pace. 0: used for comparing addresses 15 14 13 12 11 10 9 8 bit symbol ma2 read/write r/w after reset 0 0 0 0 0 0 0 1 function must always be set to 0. 23 22 21 20 19 18 17 16 bit symbol ba2 read/write r/w after reset 0 0 0 0 0 0 0 0 function sets a23-a16 for the start address. 31 30 29 28 27 26 25 24 bit symbol ba2 read/write r/w after reset 0 0 0 0 0 0 0 0 function sets a31-a24 for the start address. 7 6 5 4 3 2 1 0 bma3 bit symbol ma3 (0xffff_e40c) read/write r/w after reset 1 1 1 1 1 1 1 1 function sets the size of the cs2 s pace. 0: used for comparing addresses 15 14 13 12 11 10 9 8 bit symbol ma3 read/write r/w after reset 0 0 0 0 0 0 0 1 function must always be set to 0. 23 22 21 20 19 18 17 16 bit symbol ba3 read/write r/w after reset 0 0 0 0 0 0 0 0 function sets a23-a16 for the start address. 31 30 29 28 27 26 25 24 bit symbol ba3 read/write r/w after reset 0 0 0 0 0 0 0 0 function sets a31-a24 for the start address. note: bits 9-15 in bma2 and bma3 must always be set to 0. this is because, although the cs2 and cs3 spaces can have a size of 32 kb to 2 gb, the tmp1942?s external address space is limited to 16 mb, which requires setting bits 9-15 to 0 so as not to mask the a24-a30 address bits. figure 3.7.2 base/mask addres s registers (bma2 and bma3)
tmp1942cy/cz tmp1942cy/cz-133 figure 3.7.3 relationship between start a ddress and base address register values ( 2 ) setting the start address and address space size ? program the bma0 register as follows to cause cs0 to be asserted in the 64 kbytes of address space starting at 0xc000 _ 0000 . 31 1615 0 ba0 ma0 1 10 0 0 0 0 0 0000000000000000 0 0 0 0 0 011 c 0 0 0 0 0 0 3 bma0 register value the ba0 field specifies the upper 16 bits of the starting address , or 0xc000 . the ma0 field determines whether the a29 - a14 bits of the address should be compared or masked . the a31 and a30 bits are always compared . bits 15- 10 of the ma0 field must be cleared so that th e a29 - a24 bits are always compared . when the bma0 register is programmed as shown above , the a31 - a16 bits of the address are compared to the value of the ba0 field . consequently , the 64- kbyte address range between 0xc000 _ 0000 and 0xc000 _ ffff is defined as the 0cs space. base address value (ban) start address 0xffff_0000 0xffff_ffff ffff a ddress 0x0000_0000 64 kbytes 0x0006_0000 0006 0x0005_0000 0005 0x0004_0000 0004 0x0003_0000 0003 0x0002_0000 0002 0x0001_0000 0001 0x0000_0000 0000
tmp1942cy/cz tmp1942-134 ? program the bma2 register as follows to cause cs2 to be asserted in the 512 kbyte of address space starting at 0x1fc8 _ 0000 . 31 1615 0 ba2 ma2 0 00 1 1 1 1 1 1101000000000000 0 0 0 1 1 111 1 f d 0 0 0 1 f bma2 register value the ba2 field specifies the upper 16 bits of the starting address , or 0x1fc8 . the ma2 field determines whether the a30 - a15 bits of the address should be compared or masked . the a31 bit is always compared . bits 15 - 9 of the ma0 field must be cleared so that the a30 - a24 b its are always compared . when the bma2 register is programmed as shown above , the a31 - a19 bits of the address are compared to the value of the ba2 field . consequently , the 1 - mbyte address range between 0x1fc8 _ 0000 and 0x1fcf _ ffff is defined as the cs2 space. u pon reset , the cs0 , cs1 and cs3 spaces are disabled while the cs2 space is enabled and spans the entire 4 - gb address space. note: the tmp1942 does not assert any csn signal in the following address ranges: 0xffff_8000 through 0x1fff_bfff
tmp1942cy/cz tmp1942cy/cz-135 (3) specifying the size of an address space table 3.7.1 shows the possible sizes of each cs space . if two or more address spaces are specified which overlap one another , the address space with the lowest cs space number will be selected since it has priority . example: the start address of the cs0 space is 0xc000_0000 and the space size is 16 kbytes. the start address of the cs1 space is 0xc000_0000 and the space size is 64 kbytes. table 3.7.1 cs spaces and their possible sizes 16 k 32 k 64 k 128 k 256 k 512 k 1 m 2 m 4 m 8 m 16 m cs0 { { { { { { { { { { { cs1 { { { { { { { { { { { cs2 { { { { { { { { { { cs3 { { { { { { { { { { 0xc000_0000 0xc000_3fff 0xc000_0000 0xc000_3fff 0xc000_ffff cs1 space cs0 space when an address within the range of 0xc000_0000 to 0xc000_3fff is accessed, the cs0 space is selected. size (bytes) cs space
tmp1942cy/cz tmp1942-136 3.7.2 chip select/wait control registers the chip select / wait control registers are shown in figure 3.7.4 to figure 3.7.6 . for each address space ( i . e ., the cs0 - cs3 spaces and any other address space ), the corresponding chip select / wait control register ( b01cs - b23cs or bexcs ) can be used to enable / disable the master , select a chip select out put waveform and data bus width , set the number of wait cycles and insert dummy cycles. if two or more address spaces are specified which overlap one another , the address space with the lowest cs space number will be selected since it has priority . ( the priority order is cs0 > cs1 > cs2 > cs3 > ex cs .) b01cs (0xffff_e480), b23cs (0x ffff_e484), bexcs (0xffff_e488) 7 6 5 4 3 2 1 0 b01cs bit symbol b0om ? b0bus b0w (0xffff_e480) read/write w ? w after reset 0 0 ? 0 0 1 0 1 function selects chip select output waveform. 00: rom/ram other settings are not allowed. selects data bus width. 0: 16 bits 1: 8 bits sets the number of wait cycles 0000: 0 cycles 0001: 1 cycle 0010: 2 cycles 0011: 3 cycles 0100: 4 cycles 0101: 5 cycles 0110: 6 cycles 0111: 7 cycles 1111: (1+n) cycles other settings are not allowed. 15 14 13 12 11 10 9 8 bit symbol ? ? ? ? b0e ? b0rcv read/write ? ? ? ? w ? ? after reset ? ? ? ? 0 ? 0 0 function cs0 enable 0: disable 1: enable sets the number of dummy cycles to be inserted. (read recovery time) 00: 2 cycles 01: 1 cycle 10: none 11: setting not allowed 23 22 21 20 19 18 17 16 bit symbol b1om ? b1bus b1w read/write w ? w after reset 0 0 ? 0 0 1 0 1 function selects chip select output waveform. 00: rom/ram other settings are not allowed. selects data bus width. 0: 16 bits 1: 8 bits sets the number of wait cycles 0000: 0 cycles 0001: 1 cycle 0010: 2 cycles 0011: 3 cycles 0100: 4 cycles 0101: 5 cycles 0110: 6 cycles 0111: 7 cycles 1111: (1+n) cycles other settings are not allowed. 31 30 29 28 27 26 25 24 bit symbol ? ? ? ? b1e ? b1rcv read/write ? ? ? ? w ? w after reset ? ? ? ? 0 ? 0 0 function cs1 enable 0: disable 1: enable sets the number of dummy cycles to be inserted. (read recovery time) 00: 2 cycles 01: 1 cycle 10: none 11: setting not allowed figure 3.7.4 chip selec t/wait control registers note : ? please set the number of wait as ?+ 1 ? when you use = long and busrq the ale width .?
tmp1942cy/cz tmp1942cy/cz-137 7 6 5 4 3 2 1 0 b23cs bit symbol b2om ? b2bus b2w (0xffff_e484) read/write w ? w after reset 0 0 ? 0 0 1 0 1 function selects chip select output waveform. 00: rom/ram other settings are not allowed. selects data bus width. 0: 16 bits 1: 8 bits sets the number of wait cycles 0000: 0 cycles 0001: 1 cycle 0010: 2 cycles 0011: 3 cycles 0100: 4 cycles 0101: 5 cycles 0110: 6 cycles 0111: 7 cycles 1111: (1+n) cycles other settings are not allowed. 15 14 13 12 11 10 9 8 bit symbol ? ? ? ? b2e b2m b2rcv read/write ? ? ? ? w after reset ? ? ? ? 1 0 0 0 function cs2 enable 0: disable 1: enable selects cs2 space. 0: 4-gbyte space 1: cs space sets the number of dummy cycles to be inserted. (read recovery time) 00: 2 cycles 01: 1 cycle 10: none 11: setting not allowed 23 22 21 20 19 18 17 16 bit symbol b3om ? b3bus b3w read/write w ? w after reset 0 0 ? 0 0 1 0 1 function selects chip select output waveform. 00: rom/ram other settings are not allowed. selects data bus width. 0: 16 bits 1: 8 bits sets the number of wait cycles 0000: 0 cycles 0001: 1 cycle 0010: 2 cycles 0011: 3 cycles 0100: 4 cycles 0101: 5 cycles 0110: 6 cycles 0111: 7 cycles 1111: (1+n) cycles other settings are not allowed. 31 30 29 28 27 26 25 24 bit symbol ? ? ? ? b3e ? b3rcv read/write ? ? ? ? w ? w after reset ? ? ? ? 0 ? 0 0 function cs3 enable 0: disable 1: enable sets the number of dummy cycles to be inserted. (read recovery time) 00: 2 cycles 01: 1 cycle 10: none 11: setting not allowed note: the initial value of b23cs is 1 when am = high and 0 when am = low. figure 3.7.5 chip selec t/wait control registers note : ? please set the number of wait as ?+ 1 ? when you use = long and busrq the ale width .?
tmp1942cy/cz tmp1942-138 7 6 5 4 3 2 1 0 bexcs bit symbol bexom ? bexbus bexw (0xffff_e488) read/write w ? w after reset 0 0 ? 0 0 1 0 1 function selects chip select output waveform. 00: rom/ram other settings are not allowed. selects data bus width. 0: 16 bits 1: 8 bits sets the number of wait cycles 0000-0111: 0 cycles to 7 cycles 1111: (1+n) cycles other settings are not allowed. 15 14 13 12 11 10 9 8 bit symbol ? ? ? ? ? ? bexrcv read/write ? ? ? ? ? ? w after reset ? ? ? ? ? ? 0 0 function sets the number of dummy cycles to be inserted. (read recovery time) 00: 2 cycles 01: 1 cycle 10: none 11: setting not allowed figure 3.7.6 chip selec t/wait control registers note : ? please set the number of wait as ?+ 1 ? when you use = long and busrq the ale width .? 3.7.3 example of use figure 3 . 7 . 7 shows an example of a tmp1942 system configuration with external memory connected . in this example a 128 - kbyte rom is connected with a data width of 16 bits and 256 - kbyte ram is connected with a data width of 16 bits . figure 3.7.7 example of external memory connec tion (rom width = 16 bits, ram width = 16 bits) when the tmp1942 is reset , the po rt 4 control register ( p4cr) and port 4 function register ( p4fc ) are both cleared to 0 , so that the cs signal output is disabled . to output a cs signal from this port , set the corresponding bits in these registers to 1 , first in p4fc and then in p4cr. latch 16 tmp1942 a15 - 16 upper byte a15 ram (128 kbits 8) ram (128 kbits 8) i/01 - 8 d0 - 7 d8 - 15 a1 - 15 a16 - 17 a1 - 15 a16 - 17 le d q am1 1cs ale rom (128 kbits 16) a16 a1 - 15 ad0 - 7 ad8 - 15 a16 - 17 a15 - 16 lower byte i/01 - 8 a0 - 14 oe w/r 1ce a0 - 14 oe ce am0 wr 2cs rd hwr a0 - 14 oe w/r 1ce
tmp1942cy/cz 3.8 dma controller (dmac) the tmp1942 incorporates a four-channel dma controller. 3.8.1 features the dmac included in the tmp1942 has the following features: (1) independent 4-channel dma (2) two types of request for control of the bus: with snoop request or without snoop request (3) transfer request: internal transf er request: start by software external transfer request: request by interrupt (4) transfer mode: dual-address mode (5) transfer devices: memory-to-memory, memory-to-i/o, i/o-to-memory (6) device size: 32 bits for memory (16 or 8 bits can also be specified using the cs/wait controller); 8, 16 or 32 bits for i/o (7) address change: increment, decrement, fixed, irregular increment or irregular decrement (8) channel priority: fixed tmp1942cy/cz-139
tmp1942cy/cz tmp1942cy/cz-140 3.8.2 configuration 3.8.2.1 internal connections in the tmp1942 figure 3.8.1 shows how the dmac is connected internally within the tmp1942. figure 3.8.1 internal connection of dmac within the tmp1942 the dmac has four dma channels. these channels each receive a data transfer request signal (intdreqn) from the interrupt controlle r and return an acknowledge signal ( dackn ) in response to intdreqn. the letter ?n? denotes the channel number: 0 to 3. channel 0 has priority over channel 1, channel 1 has priority over channel 2 and channel 2 has priority over channel 3. the tx19 processor core has a snoop function. the snoop function entails the tx19 processor core releasing the core data bus to the dmac so that the dmac can access the internal rom or internal ram connected to the tx 19 processor core. the dmac can choose whether or not to use the snoop function. for details of the snoop function, refer to section 3.8.2.3 , ?snoop function?. there are two types of request for bus control: sreq and greq. the type which is selected depends on whether or not the dmac is using the snoop function. greq is used to request control of the bus when the snoop function is not in use and sreq is used to request control of the bus when the snoop function is in use. an sreq bus reques t has higher priority than a greq bus request. tx19 processor core address data indicate bus control relinquished control bus control request request release of bus control busgnt * busrel * intdreq [3 : 0]* dack [3 : 0]* dmac indicate bus control granted haveit * interrupt controller internal i/o interrupt request external interrupt request busreq * note * : internal signal note : dma channel priority exists only am ong those using the same type of bus request signal(sreq or greq).for example, once a given dma channel has acquired bus mastership using sreq, no other dma channel can assume bus mastership using greq until the ongoing dma transaction is completed.
tmp1942cy/cz tmp1942cy/cz-141 3.8.2.2 internal blocks of the dmac figure 3.8.2 shows the internal blocks of the dmac. figure 3.8.2 internal blocks of the dmac 3.8.2.3 snoop function the tx19 processor core has a snoop function. this function is used to release the tx19 processor core?s data bus to the dmac. when the snoop function is activated, the tx19 processor core releases its data bus to the dmac. at the same time the tx19 processor core stops operating and remains idle until control of the data bus is returned to it by the dmac. since the dmac can access the processor?s internal ram or internal rom while the snoop function is active, th e ram or rom can be specified as the source or destination of a transfer. the tmp1942?s internal dmac can select whet her or not to use the tx19 processor core?s snoop function. if the dmac chooses to use the snoop function, it can then access the processor?s internal ram and internal rom. the cpu in the tx19 processor core will then be stalled until the dmac cancels the bus request. if the dmac chooses not to us e the snoop function, it cannot access the processor?s internal ram or internal rom. however, si nce in this case too the g-bus is released to the dmac, if the tx19 processor core attempts to access memory or i/o via the g-bus and the dmac does not respond to the request for release of bus control, th e tx19 processor core will not be able to execute bus operation, and as a result the pipeline will stall. note: when the snoop function is not used, the tx19 processor core does not release the data bus to the dmac. therefore, if the processor? s internal ram or internal rom is specified as the source or destination of a dma transfer, no acknowledge si gnal will be returned for the dmac?s transfer cycle, resulting in the bus being locked. channel 3 channel 2 ?? - ?? ? source ?? regisuter byte count ? ? status ? ? ? - ? 31 0 channel 1 source address register (sar0) 31 0 channel 0 destination address register (dar0) byte count register (bcr0) channel control register (ccr0) channel status register (csr0) dma transfer control register (dtcr0) dma control register(dcr) data holding register(dhr)
tmp1942cy/cz tmp1942cy/cz-142 3.8.3 registers the dmac incorporates twen ty-six 32-bit registers. table 3.8.1 shows the dmac register map. table 3.8.1 dmac registers address register symbol register name 0xffff_e200 ccr0 channel control register (ch. 0) 0xffff_e204 csr0 channel status register (ch. 0) 0xffff_e208 sar0 source address register (ch. 0) 0xffff_e20c dar0 destination address register (ch. 0) 0xffff_e210 bcr0 byte count register (ch. 0) 0xffff_e218 dtcr0 dma transfer control register (ch. 0) 0xffff_e220 ccr1 channel control register (ch. 1) 0xffff_e224 csr1 channel status register (ch. 1) 0xffff_e228 sar1 source address register (ch. 1) 0xffff_e22c dar1 destination address register (ch. 1) 0xffff_e230 bcr1 byte count register (ch. 1) 0xffff_e238 dtcr1 dma transfer control register (ch. 1) 0xffff_e240 ccr2 channel control register (ch. 2) 0xffff_e244 csr2 channel status register (ch. 2) 0xffff_e248 sar2 source address register (ch. 2) 0xffff_e24c dar2 destination address register (ch. 2) 0xffff_e250 bcr2 byte count register (ch. 2) 0xffff_e258 dtcr2 dma transfer control register (ch. 2) 0xffff_e260 ccr3 channel control register (ch. 3) 0xffff_e264 csr3 channel status register (ch. 3) 0xffff_e268 sar3 source address register (ch. 3) 0xffff_e26c dar3 destination address register (ch. 3) 0xffff_e270 bcr3 byte count register (ch. 3) 0xffff_e278 dtcr3 dma transfer control register (ch. 3) 0xffff_e280 dcr dma control register (dmac) 0xffff_e28c dhr data-holding register (dmac)
tmp1942cy/cz 3.8.3.1 dma control register (dcr) 31 30 16 rst w : type 0 : initial value 15 0 : type : initial value bit mnemonic field name description 31 rst reset reset (initial value: ?) resets the dmac by software. when the rst bit is set to 1, all of the dmac?s internal registers are reset to their initial values. also, all transfer requests are canceled and the four dma channels are turned off. 0: don?t care 1: initialize the dmac. figure 3.8.3 dma control register (dcr) note1: when the snoop request is disabled (ccrn.sreq=0) , a software reset of the dmac must be performed in the following sequence: 1. disable interrupts. 2. execute nop four times. 3. perform a software reset. 4. perform a software reset again. 5. re-enable interrupts. execute steps 3 and 4 consecutively. note 2: if the software reset command is written to the dcr register immediately after the completion of the last transfer cycle of a dma transaction, the dma-done inte rrupt will not be cleared. in this case, the software reset only initializes channel registers, etc. note 3: don?t issue a software reset comma nd to the dcr register via a dma transfer. tmp1942cy/cz-143
tmp1942cy/cz tmp1942cy/cz-144 3.8.3.2 channel control registers (ccrn) 31 30 25 24 23 22 21 20 19 18 17 16 0 str ? nien abien ? ? ? ? big ? w w r/w r/w r/w r/w r/w r/w r/w r/w : type 0 1 1 1 0 0 0 1 0 : initial value 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 sac dac trsiz dps ? exr pose lev sreq relen sio dio r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w : type 0 0 0 0 0 0 0 00 0 00 00 00 : initial value bit mnemonic field name description 31 str channel start start (initial value: ?) starts channel operation. when this bit is set to 1, the channel enters ready state. data transfer can no w commence as soon as a transfer request is received. 1 is the only valid value which can be written to this bit; if a 0 is written, it is ignored. when read, this bit always appears to be 0. 1: start channel operation. 24 ? (reserved) this bit is reserved. make sure that it is always set to 0. 23 nien normal completion interrupt enable normal completion interrupt enable (initial value: 1) 1: enable normal completion interrupts. 0: disable normal completion interrupts. 22 abien abnormal completion interrupt enable abnormal completion interrupt enable (initial value 1) 1: enable abnormal completion interrupts. 0: disable abnormal completion interrupts. 21 ? (reserved) this bit is reserved. although th is bit is initially set to 1, make sure that it is always set to 0. 20 ? (reserved) this bit is reserved. make sure that it is always set to 0. 19 ? (reserved) this bit is reserved. make sure that it is always set to 0. 18 ? (reserved) this bit is reserved. make sure that it is always set to 0. 17 big big-endian big-endian (initial value: 1) 1: the channel operates in big endian mode. 0: the channel operates in little endian mode. on the tmp1942, set this bit to 0. 16 ? (reserved) this bit is reserved. make sure that it is always set to 0. 15 ? (reserved) this bit is reserved. make sure that it is always set to 0. 14 exr external request mode external request mode (initial value: 0) specifies the transfer request mode. 1: external transfer reques t (interrupt-driven start) 0: internal transfer request (soft start) 13 pose positive edge positive edge (initial value: 0) specifies the valid level for the transfer request signal intdreqn. this specification is effective only when the transfer request is an external transfer request (i.e., when the exr bit = 1). in the case of internal transfer requests (i.e., wh en the exr bit = 0) the value of pose is ignored. be sure to set the pose bit to 0 and the adjacent lev bit to 1 . figure 3.8.4 channel control registers (ccrn) (1/2)
tmp1942cy/cz bit mnemonic field name description 12 lev level mode level m ode (initial value: 0) specifies the method for requesting external transfer. this specification is effective only when the transfer request is an external transfer request (i.e., when the exr bit = 1). in the case of internal transfer requests (i.e., when the exr bit = 0), the value of lev is ignored. be sure to set the lev bit to 1. 11 sreq snoop request snoop request (initial value: 0) specifies whether or not the snoop function is to be used as the bus control request mode. when the func tion is selected for use, the tx19 processor core?s snoop function is activated with the result that the dmac can use the processor core?s data bus. when the function is not selected for use, the tx19 processor core?s snoop function remains inactive. 1: the snoop function is used (i.e., the device is in sreq mode). 0: the snoop function is not used (i .e., the device is in greq mode). 10 relen bus control release request enable release request enable (i nitial value: 0) specifies whether the dmac will respond to requests for release of bus control issued from the tx19 processor core. this function is only effective in greq mode. in sreq mode, this function would have no effect sinc e the tx19 processor core cannot generate a request for release of bus control. 1: after the dmac has taken over bus control, it will respond to requests for release of bus cont rol. when the tx19 processor core issues a request for release of bu s control, the dmac will return control of the bus to the tx19 processor core when a break in bus operation occurs. 0: the dmac will not respond to req uests for release of bus control. 9 sio source i/o source type: i/o (initial value: 0) specifies the source device from which to perform transfer. 1: i/o device 0: memory 8 : 7 sac source address count source address count (initial value: 00) specifies the way in which the source address changes. 1x: the address is fixed. 01: the address is decremented. 00: the address is incremented. 6 dio destination i/o destination type: i/o (initial value: 0) specifies the destination device to which to perform transfer. 1: i/o device 0: memory 5 : 4 dac destination address count destination address count (initial value: 00) specifies the way in which the destination address changes. 1x: the address is fixed. 01: the address is decremented. 00: the address is incremented. 3 : 2 trsiz transfer size transfe r size (initial value: 00) indicates the amount of data to be transferred in response to one transfer request. 11: 8 bits (1 byte) 10: 16 bits (2 bytes) 0x: 32 bits (4 bytes) 1 : 0 dps device port size device port size (initial value: 00) specifies the bus width for the i/o device which has been specified as the source or destination device. 11: 8 bits (1 byte) 10: 16 bits (2 bytes) 0x: 32 bits (4 bytes) figure 3.8.4 channel control registers (ccrn) (2/2) tmp1942cy/cz-145
tmp1942cy/cz tmp1942cy/cz-146 3.8.3.3 channel status registers (csrn) 31 23 22 21 20 19 18 16 0 00 act nc abc ? bes bed conf r r/w r/w r/w r r r : type 0 0 0 0 0 0 0 : initial value 15 3 2 0 0 ? ? ?? r/w : type 000 : initial value bit mnemonic field name description 31 act channel active channel ac tive (initial value: 0) indicates whether the channel is in ready state. 1: channel is in ready state. 0: channel is not in ready state. 23 nc normal completion normal co mpletion (initial value: 0) indicates whether channel operation has terminated normally. if normal completion interrupts have been enabled by the ccr register, the dmac generates an interrupt request when this bit is set to 1. the nc bit can be cleared by writing a 0 to it. if a normal completion interrupt has been requested, the interrupt request is dropped when the nc bit is set to 0. if an attempt is made to set the str bit to 1 while the nc bit = 1, an error results. be sure to clear the nc bit to 0 before starting the next transfer. writing a 1 to this bit has no effect. 1: channel operation has terminated normally. 0: channel operation has not terminated normally. 22 abc abnormal completion abnormal completion (initial value: 0) indicates whether channel operation has terminated abnormally. if abnormal completion interrupts have been enabled by the ccr register, the dmac generates an interrupt request when this abc bit is set to 1. the abc bit can be cleared by writing a 0 to it. if an abnormal completion interrupt has been requested, the interrupt request is cancelled when the abc bit is set to 0. when the abc bit is cleared, the bes, bed and conf bits are also cleared to 0. if an attempt is made to set the str bit to 1 while the abc bit = 1, an error results. be sure to clear the abc bit to 0 before starting the next transfer. writing a 1 to this bit has no effect. 1: channel operation has terminated abnormally. 0: channel operation has not terminated abnormally. 21 ? (reserved) this bit is reserved. make sure that it is always set to 0. 20 bes source bus error source bus error (initial value: 0) 1: a bus error has occurred while the source was being accessed. 0: no bus error has occurred while the source was being accessed. 19 bed destination bus error destinat ion bus error (initial value: 0) 1: a bus error has occurred while destination was being accessed. 0: no bus error has occurred while destination was being accessed. 18 conf configuration error configur ation error (initial value: 0) 1: a configuration error has occurred. 0: no configuration error has occurred. 2 : 0 ? (reserved) these three bits are all reserv ed. always set all of these bits to 0. figure 3.8.5 channel st atus registers (csrn)
tmp1942cy/cz 3.8.3.4 source address r egisters (sarn) 31 16 saddr r/w : type ? : initial value 15 0 saddr r/w : type ? : initial value bit mnemonic field name description 31:0 saddr source address source address (initial value: ?) sets the physical source address from which data will be transferred. after each transfer the address will change by the value specified in the dps bits of the ccrn register. figure 3.8.6 source ad dress registers (sarn) 3.8.3.5 destination address registers (darn) 31 16 daddr r/w : type ? : initial value 15 0 daddr r/w : type ? : initial value bit mnemonic field name description 31:0 daddr destination address destinat ion address (initial value: ?) sets the physical destinati on address to which data will be transferred. after each transfer the address will change by the value specified in the dps bits of the ccrn register. figure 3.8.7 destination address registers (darn) tmp1942cy/cz-147
tmp1942cy/cz tmp1942cy/cz-148 3.8.3.6 byte count registers (bcrn) 31 24 23 16 0 bc r/w : type ? : initial value 15 0 bc r/w : type ? : initial value bit mnemonic field name description 23:0 bc byte count byte count (initial value: ?) sets the number of bytes of data to be transferred. the amount by which the byte count is decremented after each transfer depends on the value specified in the trsiz bits of the ccrn register. figure 3.8.8 byte count registers (bcrn) 3.8.3.7 dma transfer control registers (dtcrn) 31 24 23 16 0 : type : initial value 15 5 3 2 0 0 dacm sacm r/w : type 000 000 : initial value bit mnemonic field name description 5 : 3 dacm destination address count mode destination address count mode specifies the mode used for c ounting the destination address. 000: count the address beginning at bit 0 of the address counter. 001: count the address beginning at bit 4 of the address counter. 010: count the address beginning at bit 8 of the address counter. 011: count the address beginning at bit 12 of the address counter. 100: count the address beginning at bit 16 of the address counter. 101: reserved 110: reserved 111: reserved 2 : 0 sacm source address count mode source address count mode specifies the mode used for counting the source address. 000: count the address beginning at bit 0 of the address counter. 001: count the address beginning at bit 4 of the address counter. 010: count the address beginning at bit 8 of the address counter. 011: count the address beginning at bit 12 of the address counter. 100: count the address beginning at bit 16 of the address counter. 101: reserved 110: reserved 111: reserved figure 3.8.9 dma transfer control registers (dtcrn)
tmp1942cy/cz 3.8.3.8 data-holding register (dhr) 31 16 dot r/w : type ? : initial value 15 0 dot r/w : type ? : initial value bit mnemonic field name description 31 : 0 dot data on transfer data on transfer (initial value: ?) this is the data read from the source during a transfer in dual-address mode. figure 3.8.10 data-holding register (dhr) tmp1942cy/cz-149
tmp1942cy/cz tmp1942cy/cz-150 3.8.4 functions this section describes the functions of the dmac. 3.8.4.1 outline the dmac is a 32-bit dma controller capable of performing high-speed data transfers in a system incorporating the tx19 processor core without the need for any intervention by the tx19 processor core itself. (1) source and destination the dmac performs data transfers between one memory device and another or between a memory device and an i/o device. the device from which data is transferred is referred to as the source device and the device to which data is transferred is referred to as the destination device. both memory devices and i/o devices can be specified as the source and destination devices. however, the dmac can only transfer data from a memory device to an i/o device, from an i/o device to memory, or from memory to memory; it cannot transfer data between two i/o devices. the difference between memory devices and i/o devices resides in the methods by which the devices are accessed. when the dmac accesses an i/o device, it asserts the dackn signal. because only one dackn signal line is availa ble for each channel, the dmac can only perform one data transfer involv ing an i/o device at a time; hence the dmac cannot transfer data from one i/o device to another. an interrupt source can be specified for transf er requests to the dmac. when an interrupt occurs, the interrupt controller generates a requ est to the dmac. (in this case, no interrupt request to the tx19 processor core is generated. for details, refer to section 3.4, ?interrupts?.) this interrupt request from the interrupt controlle r is canceled by the da ckn signal. therefore, when an i/o device has been set as a transfer device, a request to the dmac is cancelled for each transfer performed (i.e., each time the am ount of data specified by the trsiz bits is transferred). on the other hand, in memory-to-memory transfers, dackn is asserted only when the number of bytes to be transferred (a s specified by the value of the bcrn register) falls to 0; hence several data transfers can be performed successively by a single transfer request. for example, when the dmac is transferring data between the tmp1942?s internal i/o and internal (or external) memory, although a transfer request from the internal i/o to the dmac is cancelled for each transfer performed, the dmac is kept waiting for the next transfer request unless the number of bytes to be transferred (a s specified by the value of the bcrn register) falls to 0. consequently, dma transfer is pe rformed successively until the bcrn register value is reduced to 0.
tmp1942cy/cz (2) switching control of the bus (bus arbitration) when a transfer request is issued by the dmac s internal circuitry, the dmac requests control of the bus from the tx19 processor core. if an acknowledge signal is returned by the tx19 processor core, the dmac gains control of the bus and can perform data transfer bus cycles. the dmac can request two types of bus control: either bus control plus the use of the tx19 processor core s data bus (i.e., the snoop function), or bus control without the snoop function. this can be set independently for each channel in the corresponding register. the tx19 processor core may request release of bus control from the dmac. whether the dmac should respond to this request is set using independent register settings for each channel. however, this response function is effective only when the dmac does not request the snoop function (i.e., in greq mode). when the snoop function is requested (i.e., in sreq mode), the response function will have no eff ect because the tx19 pr ocessor core cannot generate requests for release of bus control in this mode. when there are no more transfer requests, the dmac will finish control of the bus. note1: the nmi interrupt is left pending while the dmac has control of the bus. note2: do not place the tmp1962 in halt powe r-down mode while the dmac is operating. (3) transfer request modes the dmac has two transfer request modes: in ternal transfer request mode and external transfer request mode. in internal transfer request mode, transfer re quests are generated internally in the dmac. a transfer request is generated by setting the start bit in one of the dmac s internal registers (the channel control register s str bit) to 1, upon which the dm ac will start a transfer operation. in external transfer request mode, transfer requ ests are generated by assertion of the transfer request signal (intdreqn), which is output by the interrupt controller after the start bit has been set to 1. the dmac can select level mode, in which a transfer request is generated on detection of a high- or low-level intdreqn signal, or edge mode, in which a transfer request is generated on detection of the rising or falling edge of the intdreqn signal. however, because the intdreqn signal in the tmp1942 is low-active, always make sure that the transfer request signal is set to be detected at low level. (4) address modes dual-address mode is the only address mode available for the dmac in the tmp1942. there is no single-address mode for the dmac. in dual-address mode, data transfers are performed between two memory devices or between memory and an i/o device. the addresses of the source and destination devices are output by the dmac. when accessing an i/o device, th e dmac asserts the dackn signal. in dual-address mode, the dmac executes two bus operations, one for reading and one for writing. the transfer data read from the sour ce device is temporarily stored in the dmac s internal data-holding register (dhr) before being written to the destination device. tmp1942cy/cz-151
tmp1942cy/cz tmp1942cy/cz-152 (5) channel operation the dmac has four channels (channels 0 to 3). each channel is activated by setting the start bit (str) in the channel control register (ccrn) to 1, so that the device enters ready state. when a transfer request occurs while a channel is in ready state, the dmac gains control of the bus and performs a data transfer. when th ere are no more transfer requests, the dmac finishes control of the bus, thereby entering ready state. when transfer for a channel is completed, the channel is placed in idle state. transfers may be terminated either normally or abnormally (for example, when an error occurs during transfer). an interrupt signal can be generated on completion of transfer. figure 3.8.11 is a state transition diagram for channel operations. figure 3.8.11 state transitions for channel operations (6) summary of transfer mode combinations the dmac can perform data transfers as fo llows according to the combination of mode settings. transfer request edge/level address mode transfer devices internal ? dual memory-to-memory memory-to-memory memory-to-i/o external low-level dual i/o-to-memory start transfer completed stop ready transfer bus control owned by dmac bus control not owned by dmac bus control not owned by dmac bus control owned by dmac
tmp1942cy/cz (7) address change there are essentially three methods for changing the transfer address: increment, decrement or fixed. the method can be set independently for the source and destination addresses using the sac and dac bits in the ccrn register. if the transfer device is a memory device, increment, decrement or fixed may be specified. if the transfer device is an i/o device, only fixed may be specified. when an i/o device is sel ected as the source or destination device, be sure to set the sac and dac bits in the ccrn register to ?fixed?. if ?increment? or ?decrement? is selected as the address change method, the bit position at which counting begins can be set using the sacm and dacm bits in the dtcrn register. sacm corresponds to the source address and da cm the destination address. the bit position at which counting the address begins can be specified as bit 0, 4, 8, 12 or 16. selecting bit 0 results in normal increment or decremen t, increment or ir regular decrement. examples of how the address changes are shown below. example 1: when regular increment is sele cted for the source device and irregular increment is selected for the destination device sac: increment the address dac: increment the address trsiz: transfer in units of 32 bits source address: 0xa000_1000 destination address: 0xb000_0000 sacm = 000: count the address beginning at bit 0 of the address counter dacm = 001: count the address beginning at bit 4 of the address counter source destination first time 0xa000_1000 0xb000_0000 second time 0xa000_1004 0xb000_0010 third time 0xa000_1008 0xb000_0020 fourth time 0xa000_100c 0xb000_0030 example 2: when irregular decrement is selected for the source device and regular decrement is selected fo r the destination device sac: decrement the address dac: decrement the address trsiz: transfer in units of 16 bits source address: initial value 0xa000_1000 destination address: 0xb000_0000 sacm = 010: count the address beginning at bit 8 of the address counter dacm = 000: count the address beginning at bit 0 of the address counter source destination first time 0xa000_1000 0xb000_0000 second time 0x9fff_ff00 0xafff_fffe third time 0x9fff_fe00 0xafff_fffc fourth time 0x9fff_fd00 0xafff_fffa tmp1942cy/cz-153
tmp1942cy/cz tmp1942cy/cz-154 3.8.4.2 transfer requests for data to be transferred by the dmac, a transf er request must be generated and transmitted to the dmac. there are two types of dmac transfer re quests: internal transfer requests and external transfer requests. the transfer request type can be set individually for each channel. for either type of transfer reque st, when a transfer request occurs after channel operation has been activated, the dmac will gain control of the bus and perform data transfer. ? internal transfer requests a transfer request can be generated immediately by setting the str bit in the ccrn register to 1 while the exr bit in the same register = 0. this transfer request is referr ed to as an internal transfer request. in the case of an internal tran sfer request, because the transf er request remains active until channel operation has been completed, data tr ansfers will be performed successively unless transition to a higher priority channel occurs or until bus control is transferred to a higher priority bus master. internal transfer requests can only be used for transfers between memory and memory. ? external transfer requests a transfer request is generated when the interrupt controller is notified of a transfer request by the assertion of the intdreqn signal for a channel after the channel has been placed in ready state by setting the str bit of the ccrn register to 1 while the exr bit in the ccrn register = 0. this transfer request is referred to as an external transfer request. external transfer requests can be used for transfers between tw o memory devices and between memory and an i/o device. assertion of the intdreqn signal is recognized by detecting an edge or a level. the active edge or level is specified using the pose b it in the ccrn register. however, because the intdreqn signal in the tmp1942 is low-active, alwa ys make sure that the signal is set to be detected at low level. the amount of data to be transferred for one transfer request is specified using the trsiz field in the ccrn register. this can be specifi ed as 32 bits, 16 bits or 8 bits. transfer requests from the interrupt controller are cleared by assertion of the dackn signal. the dackn signal is asserted only when the number of bytes to be transferred during an i/o device bus cycle or a memory-to-memory transf er (as specified by the value of the bcrn register) falls to 0. consequently, for data transfer between memory and an i/o device intdreqn is cancelled every transfer request with the result that only one transfer is performed for the amount of data specified by trsiz. on the other hand, in memory-to-memory transfers, in tdreqn is not cancelled until the number of bytes to be transferred (as specified by the value of the bcrn register) falls to 0; hence several data transfers can be performed successively by a single transfer request. note that if an interrupt of the type specified for intdreqn is acknowledged by the dmac, but the interrupt is cleared by the interrupt controller or by another device before the dmac starts the dma transfer, one dma transfer ma y be performed after the interrupt has been cleared.
tmp1942cy/cz 3.8.4.3 address modes the tmp 1942 only supports dual-address mode in which both the source and destination devices are explicitly addressed.. in dual-address mode the dmac first executes a r ead from the source device. the data read from the source device is temporarily stored in the dmac s internal register dhr. next, the dmac executes a write to the destination device to write this data to the destination device, thus performing a data transfer from the source to the destination device. although bit 15 of the ccrn register in the tmp1 942 can be used to specify the address mode, this bit must always be set to 0 because the tmp1942 only suppor ts dual-address mode. dmac destination device data data bus (1) address (2) (2) (1) address bus source device figure 3.8.12 diagram of data transfer in dual-address mode tmp1942cy/cz-155
tmp1942cy/cz tmp1942cy/cz-156 figure 3.8.13 diagram of data transfer in single-address mode ? dual-address mode i n dual-address mode, a data transfer is executed using two bus operations: -read operation, in which the dmac outputs the ad dress of the source device, reads data from the source device and stores the data in its internal register dhr -write operation, in which the dmac outputs the address of the des tination device and writes the stored data from dhr to the destination device in dual-address mode, three types of transfers can be performed: -memory-to-memory -memory-to-i/o device -i/o device-to-memory the units of data transfer performed by the dmac are equal to the amount of data (32 bits, 16 bits or 8 bits) specified in the trsiz field of the ccrn register. this amount of data is transferred each time a transf er request is recognized. in dual-address mode, an amount of data equal to the transfer unit is read from the source device into the dhr register, then the data is written from the dhr register to the destination device. memory accesses occur at intervals equal to the unit of data transfer which has been set. when external memory is accessed, if the transf er unit is 32 bits and the bus width set by the cs/wait controller is 16 bits, then two 16-bit accesses will occur. si milarly, if the transfer unit is 32 bits and the bus width set by the cs/wait controller is 8 bits, then four 8-bit accesses will occur. data bus address bus dmac destination device (memory) data dack address source device (i/o)
tmp1942cy/cz for memory-to-i/o device or i/o device-to-memory data transfers, the bus width of the i/o device (the device port size) needs to be set (to 32 bits, 16 bits or 8 bits) using the dps field in the ccrn register, in addition to the unit of data transfer. if the unit of data transfer and the device port size are equal, the dmac will perform one read or write operation for the i/o device. if the device port size is smaller than the unit of data transfer, the dmac will perform multiple read or write operations for the i/o device. for example, when performing a transfer to memory from an i/o device whose device port size is 8 bits when the unit of data transfer is 32 bits, the dmac will read data from the i/o device and store it in the dhr register four times, 8 bits at a time, and then write 32 bits of data from the dhr register to memory in one operation (or in two operations if the external memory s data bus is 16 bits wide). the source and destination addresses change at intervals equal to the unit of data transfer. the value of the bcrn register also changes by an amount equal to the unit of data transfer. the device port size cannot be set to a valu e greater than the unit of data transfer. table 3.8.2 summarizes the above information: table 3.8.2 unit of data transfer and device port size (dual-address mode) trsiz dps number of bus operations performed on i/o device 0x (32 bits) 0x (32 bits) once 0x (32 bits) 10 (16 bits) twice 0x (32 bits) 11 (8 bits) four times 10 (16 bits) 0x (32 bi ts) setting prohibited 10 (16 bits) 10 (16 bits) once 10 (16 bits) 11 (8 bits) twice 11 (8 bits) 0x (32 bi ts) setting prohibited 11 (8 bits) 10 (16 bi ts) setting prohibited 11 (8 bits) 11 (8 bits) once note: the dmac does not incremnt or decrement the address for i/o peripherals. therefore, if, for example, trsiz is programmed to 16 bits and dps is programmed to 8 bits, both the first and second bus cycles access the lower eight bits of the i/o data bus. tmp1942cy/cz-157
tmp1942cy/cz tmp1942cy/cz-158 3.8.4.4 channel operations a chann el is activated when the str bit in the ccr n register for the channel is set to 1. when a channel is activated, it is checked for errors; if no error is found, it is placed in ready state. if a transfer request occurs while a channel is in ready state, the dmac gains control of the bus and starts a tran sfer operation. channel operation may terminate normally or a bnormally, for example, when operation is forcibly terminated or terminated by an error. this status is indicated by the csrn register. (1) starting channel operation a channel is activated when the str bit in th e ccrn register for the channel is set to 1. when a channel is activated, it is checked for a configuration erro r; if no error is found, it is placed in ready state. if an error is detected , the channel operation terminates abnormally. when a channel is placed in ready state, the act b it in the csrn register fo r the channel is set to 1. if internal transfer requests have been set for the channel, a transfer request will be generated immediately, upon which the dmac will gain cont rol of the bus and start a data transfer. if external transfer requests have been set for the channel, a transfer requ est will be generated by assertion of intdreqn, upon which the dmac w ill gain control of the bus and start a data transfer. (2) terminating channel operation channel operation may terminate either normally or abnormally. this st atus is indicated in the csrn register. if an attempt is made to set the str bit in the ccrn register to 1 while the nc bit or abc bit of the csrn register = 1, channel operatio n will not start and will terminate abnormally. normal termination channel operation terminates normally in the following case. note that, in this case, transfer will always terminate after the dmac has finished transferring an amount of data equal to the unit of data transfer (the value set in the trsiz field of the ccrn register). ? when data transfer has been completed after the value of the bcrn register has fallen to 0 abnormal termination data transfers by the dmac may terminate abnormally in the following cases: ? termination due to configuration errors a configuration error is an error in the dma transfer settings. since a configuration error occurs before the dmac starts data tr ansfer operation, the sarn, darn and bcrn register values will remain as set. when operation for a channel terminates abnormally due to a configuration error, the conf bit in the csrn register is set to 1 at the same time that the abc bit is set to 1. causes of co nfiguration errors are shown below. -both sio and dio are set to 1. -the ccrn str bit is set to 1 when the nc bit or abc bit in the csrn register = 1.
tmp1942cy/cz -a value which cannot be divided by the unit of data transfer is set in the bcrn register. -values which cannot be divided by the unit of data transfer are set in the sarn and darn registers. -an illegal combination of the device port size and data transfer unit has been set. -the str bit in the ccrn register is set to 1 while the bcrn register = 0. ? termination due to bus errors w hen transfer terminates abnormally due to a bus error, the bes or bed bit in the csrn register is set to 1 at the same time that the abc bit in the csrn register is set to 1. -the cpu is notified that a bus erro r has occurred during data transfer. 3.8.4.5 channel priority the dmac has four channels. a channel with a lo wer channel number always has higher priority. therefore, if transfer requests occur for channe ls 0 and 1 simultaneously, the dmac will perform the transfer operation for channel 0 s transfer request first. when there are no more transfer requests for channel 0, if the transfer request for channe l 1 is still in effect, the dmac will perform the transfer operation on channe l 1. (for internal transfer requests, th e transfer request is held unless it is cleared. for external transfer requ ests, this depends on the active state which has been set for the interrupt request assigned to dma requests by the interrupt controller. if the active state is set to edge mode, the transfer request will be held by the in terrupt controller. however, if the active state is set to level mode, the interrupt controller will not hold the transfer request. therefore, if level mode is set, the interrupt request signal must be kept asserted until it is recognized by the dmac.) if a transfer request for channel 0 occurs while da ta transfer on channel 1 is under way, a channel transition will occur. the data tr ansfer on channel 1 will be su spended and the dmac will start transfer on channel 0. when there are no more transfer request for channel 0, the dmac will resumes the transfer operation on channel 1. channel transition occurs when the dmac has finished transferring an amount of data equal to the unit of data transfer. in dual- address mode, this is when the dmac has finished writing all the stored data from the dhr register to the destination device. 3.8.4.6 interrupts the dma c can generate an interrupt request to the tx19 processor core on completion of channel operation. there are two ty pes of interrupts which can be requested in this case: normal completion interrupt and abnormal completion interrupt. ? normal completion interrupt w hen channel operation terminates normally, the nc bit in the csrn register is set to 1. at this time, if normal completion interrupts have been enabled using the nien bit in the ccrn register, an interrupt request to th e tx19 processor core is generated. ? abnormal completion interrupt w hen channel operation terminates abnormally, the abc bit in the csrn register is set to 1. at this time, if abnormal completion interrupts have been enabled by the abien bit in the ccrn register, an interrupt request to th e tx19 processor core is generated. tmp1942cy/cz-159
tmp1942cy/cz tmp1942cy/cz-160 3.8.4.7 endian mode if the unit of data transfer and the device port size are not equal in dual-address mode, the dmac will assemble or disassemble data in the dhr register. for example, if the source device is an i/o device whose port size is 8 bits while the destination device is a memory device, and the unit of data tran sfer is 32 bits, the dmac reads data from the i/o device four times and assembles it into 32 bits of data in the dhr register before writing it to memory. for example, the diagram below shows the relationship between an 8-bit i/o device and a 32-bit dhr register. the tmp1942 supports only little-endian data alignment. figure 3.8.14 data packing and unpacking d c b a 4n + 0 4n + 1 4n + 2 4n + 3 i/o device 8 0 big endian 31 0 dhr little endian 31 0 d c b a a b c d
tmp1942cy/cz tmp1942cy/cz-161 3.8.5 operation dmac operations are synchronized to the rising edges of sysclk. 3.8.5.1 dual-address mode ? memor y-to-memory transfer figure 3.8.15 shows a timing example for one transfer session when 16-bit data is being transferred from external memory (which is 16 bits wide) to external memory (which is also 16 bits wide). although it is not shown here, data is transferred successively until the value of the bcrn register falls to 0. figure 3.8.15 dual-address mode (memory to memory) ? memory-to-i/o device transfer figure 3.8.16 shows a timing example for memory-to-i/o device transfer for cases where the unit of data transfer and the device port size ar e set to 16 bits and 8 bits, respectively. figure 3.8.16 dual-address mode (memory to i/o device) addr a [23 : 16] 0cs rd wr / whr ad [15 : 0] read write data addr data 1cs tsys addr a [23 : 16] 0cs rd wr ad [15 : 0] read write data addr data 1cs write addr data tsys
tmp1942cy/cz tmp1942cy/cz-162 ? i/o device-to-memory transfer figure 3.8.17 shows a timing example for i/o device-to -memory transfer for cases where the unit of data transfer and the device port size ar e set to 16 bits and 8 bits, respectively. figure 3.8.17 dual-address mode (i/o device to memory) addr a [23 : 16] 0cs rd wr / whr ad [15 : 0] read read data 1cs write addr data addr data tsys
tmp1942cy/cz example: dma transfer of serially r eceived data (scnbuf) to internal ram example dma settings ? channel used: 0 ? source address: sc1buf ? destination: 0xffff_9800 (physical address) ? number of bytes transferred: 256 example serial channel settings ? data length: 8 bits, uart ? serial channel: channel 1 ? transfer rate: 9600 bps dma (channel 0) is used for transfer. dma0 is activated by an interrupt received on sio1. dma0 settings dcr 0x8000_0000 /* reset dma * / imcfl 15 7 0 xxxx, xxxx, xx10, x100 /* level = 4 (arbitrary value) * / intclr 0x3c /* value of ivr [9:4] * / dtcr0 0x0000_0000 /* dacm = 000 * / /* sacm = 000 * / sar0 0xffff_f208 /* physical address of sc1buf * / dar0 0xffff_9800 /* physical address of destination * / bcr0 0x0000_00ff /* 256 (number of bytes to be transferred) * / ccr0 0x80c0_5b0f (contents) 31 27 23 19 1 000000011000 0 0 0 15 11 7 3 0 1011 x 11 x 0001 1 1 1 sio channel 1 settings imcch 31 15 xxxx, xxxx, xx11, 1000 /* assign to dmc0 activation source * / intclr 0x32 /* ivr [9:4], intrx1 interrupt source * / sc1mod0 0x29 /* uart mode, 8-bit length, baud rate generator * / sc1cr 0x00 br1cr 0x1d /* @fc = 32 mhz (approx. 9615 bps) * / tmp1942cy/cz-163
tmp1942cy/cz tmp1942cy/cz-164 3.9 8-bit timers (tmra) the tmp1942 contains twelve 8-b it timer channels (tmra0-tmrab). there are six tmra modules, referred to as tmra01, tmra23, tmra45, tmra67, tmra89 and tmraab, each of which is comprised of two channels. each module can operate in the following four modes: ? 8-bit interval timer mode ? 16-bit interval timer mode ? 8-bit programmable square wave output mode (ppg: variable duty with variable cycle) ? 8-bit pulse width modulation output mode (pwm: variable duty with constant cycle) figure 3.9.1 shows a block diagram of tmra01. each channel consists primarily of an 8-bit up-counter, an 8- bi t comparator and an 8-bit timer register. each pair of channels also incorpor ates one prescaler and one timer flip-flop. timer operation modes and f lip-flops are controlled by five registers. the six modules (tmra01, tmra23, tmra45, tmra67, tmra89 and tmraab) operate independently of each other. because each module functions the same way except for a few differences as shown in tables table 3.9.1 and table 3.9.2, operation of the tmra01 only is described here. t able 3.9.1 s pecification differences among the tmra modules module specification tmra01 tmra23 tmra45 external clock input pin ta0in (shared with pa7) ta2in (shared with pb7) ta4in (shared with pc0) external pins timer flip-flop output pin ta1out (shared with pa6) ta3out (shared with pb6) ta5out (shared with pc3) timer run register ta01run (0xffff_f100) ta23run (0xffff_f108) ta45run (0xffff_f110) timer registers ta0reg (0xffff_f102) ta1reg (0xffff_f103) ta2reg (0xffff_f10a) ta3reg (0xffff_f10b) ta4reg (0xffff_f112) ta5reg (0xffff_f113) timer mode register ta01mod (0xffff_f104) ta23mod (0x ffff_f10c) ta45mod (0x ffff_f114) sfr name (address) timer flip-flop control register ta1ffcr (0xffff_f105) ta3ffcr (0xffff_f10d) ta5ffcr (0xffff_f115) table 3.9.2 specification differences among the tmra modules module specification tmra67 tmra89 tmraab external clock input pin ta6in (shared with pc1) ta8in (shared with pc2) taain (shared with pc4) external pins timer flip-flop output pin ta7out (shared with pc5) ta9out (shared with pc7) tabout (shared with pd5) timer run register ta67run (0xffff_f118) ta89run (0xffff_f120) taabrun (0xffff_f128) timer registers ta6reg (0xffff_f11a) ta7reg (0xffff_f11b) ta8reg (0xffff_f122) ta9reg (0xffff_f123) taareg (0xffff_f12a) tabreg (0xffff_f12b) timer mode register ta67mod (0x ffff_f11c) ta89mod (0x ffff_f124) t aabmod (0xffff_f12c) sfr name (address) timer flip-flop control register ta7ffcr (0xffff_f11d) ta9ffcr (0xffff_f125) tabffcr (0xffff_f12d)
tmp1942cy/cz tmp1942cy/cz-165 3.9.1 block diagram of each module only a block diagram of tmra01 is described here. it applies to all other modules with the exception of differences in register, signal and other element names. figure 3.9.1 tmra01 block d iagram run/clear prescaler clock: t0 ta0trg external clock input: ta0in ta01mod selector 8-bit up-counter (uc1) 8-bit comparator (cp1) 8-bit up-counter (uc0) 8-bit timer register ta1reg 8-bit comparator (cp0) match detection register buffer 0 8-bit timer register ta0reg ta01run ta01run t1 t4 t16 2 n ?1 overflow tmra0 interrupt output: intta0 ta01mod tmra0 match output: ta0trg selector t1 t16 t256 internal data bus ta01mod ta01mod match detection tmra1 interrupt output: intta1 ta01run timer flip-flop ta1ff ta1ffcr timer flip-flop output: ta1out 512 256 128 64 32 16 8 4 2 t1 t4 t16 t256 prescaler ta01run internal data bus
tmp1942cy/cz tmp1942cy/cz-166 3.9.2 functional description of each circuit (1) prescaler the tmp1942 has a 9-bit prescaler to supply a clock to tmra01. the prescaler?s input clock t0 has a frequency of fperiph, fperiph/2 or fperiph/4 as selected by syscr0 in the cg block. fperiph is either the clock fgear as selected by syscr1 in the cg block or the clock fc before division by the clock gear. the prescaler is set to either run or stop by ta01run. writing a 1 to this bit causes the prescaler to start counting and writing 0 causes it to clear itself and stop counting. table 3.9.3 shows the resolutions of th e prescaler output clocks. table 3.9.3 prescaler output clock resolutions @fc = 32 mhz prescaler output clock resolution peripheral clock selection clock gear value selected prescaler clock t1 t4 t16 t256 00 (fperiph/4) fc/2 3 (0.25 s) fc/2 5 (1.0 s) fc/2 7 (4.0 s) fc/2 11 (64 s) 01 (fperiph/2) fc/2 2 (0.125 s) fc/2 4 (0.5 s) fc/2 6 (2.0 s) fc/2 10 (32 s) 00 (fc) 10 (fperiph) ? fc/2 3 (0.25 s) fc/2 5 (1.0 s) fc/2 9 (16 s) 00 (fperiph/4) fc/2 4 (0.5 s) fc/2 6 (2.0 s) fc/2 8 (8.0 s) fc/2 12 (128 s) 01 (fperiph/2) fc/2 3 (0.25 s) fc/2 5 (1.0 s) fc/2 7 (4.0 s) fc/2 11 (64 s) 01 (fc/2) 10 (fperiph) ? fc/2 4 (0.5 s) fc/2 6 (2.0 s) fc/2 10 (32 s) 00 (fperiph/4) fc/2 5 (1.0 s) fc/2 7 (4.0 s) fc/2 9 (16 s) fc/2 13 (256 s) 01 (fperiph/2) fc/2 4 (0.5 s) fc/2 6 (2.0 s) fc/2 8 (8.0 s) fc/2 12 (128 s) 10 (fc/4) 10 (fperiph) ? fc/2 5 (1.0 s) fc/2 7 (4.0 s) fc/2 11 (64 s) 00 (fperiph/4) fc/2 6 (2.0 s) fc/2 8 (8.0 s) fc/2 10 (32 s) fc/214 (512 s) 01 (fperiph/2) fc/2 5 (1.0 s) fc/2 7 (4.0 s) fc/2 9 (16 s) fc/2 13 (256 s) 0 (fgear) 11 (fc/8) 10 (fperiph) ? fc/2 6 (2.0 s) fc/2 8 (8.0 s) fc/2 12 (128 s) 00 (fperiph/4) fc/2 3 (0.25 s) fc/2 5 (1.0 s) fc/2 7 (4.0 s) fc/2 11 (64 s) 01 (fperiph/2) fc/2 2 (0.125 s) fc/2 4 (0.5 s) fc/2 6 (2.0 s) fc/2 10 (32 s) 00 (fc) 10 (fperiph) ? fc/2 3 (0.25 s) fc/2 5 (1.0 s) fc/2 9 (16 s) 00 (fperiph/4) fc/2 3 (0.25 s) fc/2 5 (1.0 s) fc/2 7 (4.0 s) fc/2 11 (64 s) 01 (fperiph/2) ? fc/2 4 (0.5 s) fc/2 6 (2.0 s) fc/2 10 (32 s) 01 (fc/2) 10 (fperiph) ? fc/2 3 (0.25 s) fc/25 (1.0 s) fc/2 9 (16 s) 00 (fperiph/4) ? fc/2 5 (1.0 s) fc/2 7 (4.0 s) fc/2 11 (64 s) 01 (fperiph/2) ? fc/2 4 (0.5 s) fc/2 6 (2.0 s) fc/2 10 (32 s) 10 (fc/4) 10 (fperiph) ? ? fc/2 5 (1.0 s) fc/2 9 (16 s) 00 (fperiph/4) ? fc/2 5 (1.0 s) fc/2 7 (4.0 s) fc/2 11 (64 s) 01 (fperiph/2) ? ? fc/2 6 (2.0 s) fc/2 10 (32 s) 1 (fc) 11 (fc/8) 10 (fperiph) ? ? fc/2 5 (1.0 s) fc/2 9 (16 s) note 1: the prescaler?s output clock tn must be selected such that the relationship tn < fsys/2 is satisfied (i.e., tn must be slower than fsys/2). note 2: do not change the clock gear value while the timer is operating. note 3: the - character meams ?don?t use?.
tmp1942cy/cz tmp1942cy/cz-167 (2) up-counters (uc0 and uc1) uc0 and uc1 are 8-bit binary counters which count up synchronously with the input clock selected in timer mode register ta01mod. the input clock for uc0 is either the external cloc k entered via the ta0in pin or one of the three prescaler output clocks, t1, t4 or t16, according to the value set in ta01mod . the input clock for uc1 varies with the operating mode. in 16-bit timer mode, up-counter uc0?s overflow output is the input clock for uc1; in any other mode, the input clock for uc1 is either one of the three prescaler output clocks, t1, t16 or t256, or the comparator ou tput (match detection) from tmra0, as determined by the value set in ta01mod. the ta01run and bits set the up-counters to run or stop. when reset, the up-counters are cleared with the timers stopped. (3) timer registers (ta0reg and ta1reg) ta0reg and ta1reg are 8-bit registers used to se t interval times. when the value set in one of these timer registers matches the corresponding up-counter value, the comparator?s match detection signal becomes active. if the value set is 00h, th is signal will become active when the up-counter overflows. ta0reg is paired with a register buffer to fo rm a dual-buffer structure. the double-buffer is controlled by the setting of ta01run. the double-buffer is disabled when = 0 and enabled when = 1. when the double-buffer is enabled, data transfer from the register buffer to the timer register is initiated by a 2 n -1 overflow in pwm mode or by cycle match detection in ppg mode. the double-buffer cannot be used in timer mode. when reset, is initialized to 0, disabling the double-buffer. to use the double-buffer, write data in the timer register and set to 1, then write the following data in the register buffer. figure 3.9.2 shows the structure of ta0reg.
tmp1942cy/cz tmp1942cy/cz-168 figure 3.9.2 structure of timer register 0 (ta0reg) note: when data is written to ta0reg, the same address is allocated to the timer register and the register buffer. when = 0, the same value is writt en to the timer register and the register buffer. when = 1, data is written only to the register buffer. the addresses of the individual timer registers are as follows: ta0reg: 0xffff_f102h ta1reg: 0xffff_f103h ta2reg: 0xffff_f10ah ta3reg: 0xffff_f10bh each register is a write-only register and cannot be read. (4) comparator (cp0) this circuit compares the up-count er value with the timer register value. when the values match, it clears the up-counter to 0 and at the same time ge nerates an intta0 or intta1 interrupt. also, if timer flip-flop inversion is enabled, it inverts the timer flip-flop value. (5) timer flip-flop (ta1ff) the timer flip-flop ta1ff is designed to be inverted by a match detection signal from the comparator. inversion can be disabled or enabled by setting ta1ffcr. ta1ff is cleared to 0 by a reset. the ta1ff value can be set to 1 or 0 by writing 01 or 10 to ta1ffcr. also, the ta1ff value can be inverted by writing 00 to these bits (this is known as a soft inversion). the ta1ff value can be forwarded to the timer flip-flop output pin, ta1out (shared with pa6). when timer output is needed, this pin must be set for that purpose by using the port a registers pacr and pafc. selector write shift trigger write to ta0reg pwm 2 n -1 overflow ta01run up-counter comparator (cp0) timer register 0 (ta0reg) register buffer 0 internal data bus ppg cycle match detection y b a s
tmp1942cy/cz tmp1942cy/cz-169 3.9.3 register description tmra01 run register 7 6 5 4 3 2 1 0 bit symbol ta0rde ? ? ? i2ta01 ta01prun ta1run ta0run read/write r/w ? ? ? r/w after reset 0 ? ? ? 0 0 0 0 function double buffer 0: disable 1: enable idle 0: idle 1: operate timer run/stop control 0: stop and cleared 1: count i2ta01: operation in idle mode ta01prun: operation of the prescaler ta1run: operation of timer 1 ta0run: operation of timer 0 note: ta01run bits 4, 5 and 6 are undefined when read. tmra23 run register 7 6 5 4 3 2 1 0 bit symbol ta2rde ? ? ? i2ta23 ta23prun ta3run ta2run read/write r/w ? ? ? r/w after reset 0 ? ? ? 0 0 0 0 function double buffer 0: disable 1: enable idle 0: idle 1: operate timer run/stop control 0: stop and cleared 1: count i2ta23: operation in idle mode ta23prun: operation of the prescaler ta3run: operation of timer 3 ta2run: operation of timer 2 note: ta23run bits 4, 5 and 6 are undefined when read. figure 3.9.3 tmra registers this bit controls the ta0reg double-buffer. 0 disable 1 enable ta23run (0xffff_f108) this bit controls the ta2reg double-buffer. 0 disable 1 enable ta01run (0xffff_f100)
tmp1942cy/cz tmp1942cy/cz-170 tmra45 run register 7 6 5 4 3 2 1 0 bit symbol ta4rde ? ? ? i2ta45 ta45prun ta5run ta4run read/write r/w ? ? ? r/w after reset 0 ? ? ? 0 0 0 0 function double buffer 0: disable 1: enable i d l e 0: idle 1: operate timer run/stop control 0: stop and cleared 1: count i2ta45: operation in idle mode ta45prun: operation of the prescaler ta5run: operation of timer 5 ta4run: operation of timer 4 note: ta45run bits 4, 5 and 6 are undefined when read. tmra67 run register 7 6 5 4 3 2 1 0 bit symbol ta6rde ? ? ? i2ta67 ta67prun ta7run ta6run read/write r/w ? ? ? r/w after reset 0 ? ? ? 0 0 0 0 function double buffer 0: disable 1: enable i d l e 0: idle 1: operate timer run/stop control 0: stop and cleared 1: count i2ta67: operation in idle mode ta67prun: operation of the prescaler ta7run: operation of timer 7 ta6run: operation of timer 6 note: ta67run bits 4, 5 and 6 are undefined when read. figure 3.9.4 tmra registers ta45run (0xffff_f110 ) this bit controls the ta4reg double-buffer. 0 disable 1 enable this bit controls the ta6reg double-buffer. 0 disable 1 enable ta67run (0xffff_f118)
tmp1942cy/cz tmp1942cy/cz-171 tmra89 run register 7 6 5 4 3 2 1 0 bit symbol ta8rde ? ? ? i2ta89 ta89prun ta9run ta8run read/write r/w ? ? ? r/w after reset 0 ? ? ? 0 0 0 0 function double buffer 0: disable 1: enable i d l e 0: idle 1: operate timer run/stop control 0: stop and cleared 1: count i2ta89: operation in idle mode ta89prun: operation of the prescaler ta9run: operation of timer 9 ta8run: operation of timer 8 note: ta89run bits 4, 5 and 6 are undefined when read. tmraab run register 7 6 5 4 3 2 1 0 bit symbol taarde ? ? ? i2taab taabprun tabrun taarun read/write r/w ? ? ? r/w after reset 0 ? ? ? 0 0 0 0 function double buffer 0: disable 1: enable i d l e 0: idle 1: operate timer run/stop control 0: stop and cleared 1: count i2taab: operation in idle mode taabprun: operation of the prescaler tabrun: operation of timer b taarun: operation of timer a note: taabrun bits 4, 5 and 6 are undefined when read. figure 3.9.5 tmra registers this bit controls the ta8reg double-buffer. 0 disable 1 enable this bit controls the taareg double-buffer. 0 disable 1 enable ta89run (0xffff_f120 ) taabrun (0xffff_f128)
tmp1942cy/cz tmp1942cy/cz-172 tmra01 mode register 7 6 5 4 3 2 1 0 bit symbol ta01m1 ta01m0 pwm01 pwm0 0 ta1clk1 ta1clk0 ta0clk1 ta0clk0 read/write r/w after reset 0 0 0 0 0 0 0 0 function operating mode 00: 8-bit timer 01: 16-bit timer 10: 8-bit ppg 11: 8-bit pwm pwm cycle 00: reserved 01: 2 6 -1 10: 2 7 -1 11: 2 8 -1 tmra1 source clock 00: ta0trg 01: t1 10: t16 11: t256 tmra0 source clock 00: ta0in pin input 01: t1 10: t4 11: t16 00 external input (ta0in pin input) 01 t1 (prescaler) 10 t4 (prescaler) 11 t16 (prescaler) ta01mod 01 ta01mod = 01 00 tmra0 match detection 01 t1 10 t16 11 t256 tmra0 overflow output 00 reserved 01 (2 6 -1) clock source 10 (2 7 -1) clock source 11 (2 8 -1) clock source 00 8-bit timer 2 01 16-bit timer 10 8-bit programmable square wave output 11 8-bit pwm (tmra0), 8-bit timer (tmra1) figure 3.9.6 tmra registers ta01mod (0xffff_f104) selects cycle in 8-bit pwm mode tmra0 input clock tmra1 input clock selects operating mode for tmra01 16-bit timer mode
tmp1942cy/cz tmp1942cy/cz-173 tmra23 mode register 7 6 5 4 3 2 1 0 bit symbol ta01m1 ta01m0 pwm01 pwm0 0 ta1clk1 ta1clk0 ta0clk1 ta0clk0 read/write r/w after reset 0 0 0 0 0 0 0 0 function operating mode 00: 8-bit timer 01: 16-bit timer 10: 8-bit ppg 11: 8-bit pwm pwm cycle 00: reserved 01: 2 6 -1 10: 2 7 -1 11: 2 8 tmra3 source clock 00: ta2trg 01: t1 10: t16 11: t256 tmra2 source clock 00: ta2in pin input 01: t1 10: t4 11: t16 00 external input (ta2in pin input) 01 t1 (prescaler) 10 t4 (prescaler) 11 t16 (prescaler) ta23mod 01 ta23mod = 01 00 tmra2 match detection 01 t1 10 t16 11 t256 tmra2 overflow output 00 reserved 01 (2 6 -1) clock source 10 (2 7 -1) clock source 11 (2 8 -1) clock source 00 8-bit timer 2 01 16-bit timer 10 8-bit programmable square wave output 11 8-bit pwm (tmra2), 8-bit timer (tmra3) figure 3.9.7 tmra registers ta23mod (0xffff_f10c) selects cycle in 8-bit pwm mode tmra2 input clock tmra3 input clock selects operating mode for tmra23 16-bit timer mode
tmp1942cy/cz tmp1942cy/cz-174 tmra45 mode register 7 6 5 4 3 2 1 0 bit symbol ta45m1 ta45m0 pwm41 pwm4 0 ta5clk1 ta5clk0 ta4clk1 ta4clk0 read/write r/w after reset 0 0 0 0 0 0 0 0 function operating mode 00: 8-bit timer 01: 16-bit timer 10: 8-bit ppg 11: 8-bit pwm pwm cycle 00: reserved 01: 2 6 -1 10: 2 7 -1 11: 2 8 -1 tmra5 source clock 00: ta4trg 01: t1 10: t16 11: t256 tmra4 source clock 00: ta4in 01: t1 10: t4 11: t16 00 ta4in 01 t1 (prescaler) 10 t4 (prescaler) 11 t16 (prescaler) ta45mod 01 ta45mod = 01 00 tmra4 match detection 01 t1 10 t16 11 t256 tmra4 overflow output 00 reserved 01 (2 6 -1) clock source 10 (2 7 -1) clock source 11 (2 8 -1) clock source 00 8-bit timer 2 01 16-bit timer 10 8-bit programmable square wave output 11 8-bit pwm (tmra4), 8-bit timer (tmra5) figure 3.9.8 tmra registers ta45mod (0xffff_f114) selects cycle in 8-bit pwm mode tmra4 input clock tmra5 input clock selects operating mode for tmra45 16-bit timer mode
tmp1942cy/cz tmp1942cy/cz-175 tmra67 mode register 7 6 5 4 3 2 1 0 bit symbol ta67m1 ta67m0 pwm61 pwm6 0 ta7clk1 ta7clk0 ta6clk1 ta6clk0 read/write r/w after reset 0 0 0 0 0 0 0 0 function operating mode 00: 8-bit timer 01: 16-bit timer 10: 8-bit ppg 11: 8-bit pwm pwm cycle 00: reserved 01: 2 6 -1 10: 2 7 -1 11: 2 8 -1 tmra7 source clock 00: ta6trg 01: t1 10: t16 11: t256 tmra6 source clock 00: ta6in 01: t1 10: t4 11: t16 00 ta6in 01 t1 (prescaler) 10 t4 (prescaler) 11 t16 (prescaler) ta67mod 01 ta67mod = 01 00 tmra6 match detection 01 t1 10 t16 11 t256 tmra6 overflow output 00 reserved 01 (2 6 -1) clock source 10 (2 7 -1) clock source 11 (2 8 -1) clock source 00 8-bit timer 2 01 16-bit timer 10 8-bit programmable square wave output 11 8-bit pwm (tmra6), 8-bit timer (tmra7) figure 3.9.9 tmra registers ta67mod (0xffff_f11c) selects cycle in 8-bit pwm mode tmra6 input clock tmra7 input clock selects operating mode for tmra67 16-bit timer mode
tmp1942cy/cz tmp1942cy/cz-176 tmra89 mode register 7 6 5 4 3 2 1 0 bit symbol ta89m1 ta89m0 pwm81 pwm8 0 ta9clk1 ta9clk0 ta8clk1 ta8clk0 read/write r/w after reset 0 0 0 0 0 0 0 0 function operating mode 00: 8-bit timer 01: 16-bit timer 10: 8-bit ppg 11: 8-bit pwm pwm cycle 00: reserved 01: 2 6 -1 10: 2 7 -1 11: 2 8 -1 tmra9 source clock 00: ta8trg 01: t1 10: t16 11: t256 tmra8 source clock 00: ta8in 01: t1 10: t4 11: t16 00 ta8in 01 t1 (prescaler) 10 t4 (prescaler) 11 t16 (prescaler) ta89mod 01 ta89mod = 01 00 tmra8 match detection 01 t1 10 t16 11 t256 tmra8 overflow output 00 reserved 01 (2 6 -1) clock source 10 (2 7 -1) clock source 11 (2 8 -1) clock source 00 8-bit timer 2 01 16-bit timer 10 8-bit programmable square wave output 11 8-bit pwm (tmra8), 8-bit timer (tmra9) figure 3.9.10 tmra registers ta89mod (0xffff_f124) selects cycle in 8-bit pwm mode tmra8 input clock tmra9 input clock selects operating mode for tmra89 16-bit timer mode
tmp1942cy/cz tmp1942cy/cz-177 tmraab mode register 7 6 5 4 3 2 1 0 bit symbol taabm1 taabm0 pwma1 pwma0 tabclk1 tabclk0 taaclk1 taaclk0 read/write r/w after reset 0 0 0 0 0 0 0 0 function operating mode 00: 8-bit timer 01: 16-bit timer 10: 8-bit ppg 11: 8-bit pwm pwm cycle 00: reserved 01: 2 6 -1 10: 2 7 -1 11: 2 8 -1 tmrab source clock 00: taatrg 01: t1 10: t16 11: t256 tmraa source clock 00: taain 01: t1 10: t4 11: t16 00 taain 01 t1 (prescaler) 10 t4 (prescaler) 11 t16 (prescaler) taabmod 01 taabmod = 01 00 tmraa match detection 01 t1 10 t16 11 t256 tmraa overflow output 00 reserved 01 (2 6 -1) clock source 10 (2 7 -1) clock source 11 (2 8 -1) clock source 00 8-bit timer 2 01 16-bit timer 10 8-bit programmable square wave output 11 8-bit pwm (tmraa), 8-bit timer (tmrab) figure 3.9.11 tmra registers taabmod (0xffff_f12c) selects cycle in 8-bit pwm mode tmraa input clock tmrab input clock selects operating mode for tmraab 16-bit timer mode
tmp1942cy/cz tmp1942cy/cz-178 tmra1 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? taff1c1 taff1c0 taff1ie taff1is read/write ? ? ? ? r/w after reset ? ? ? ? 1 1 0 0 function 00: invert ta1ff value (soft inversion). 01: set ta1ff to 1. 10: clear ta1ff to 0. 11: don?t care (these bits are always 11 when read.) controls ta1ff inversion. 0: disable inversion. 1: enable inversion . selects ta1ff inversion signal. 0: tmra0 1: tmra1 0 inverted by tmra0 1 inverted by tmra1 note: ta1ffcr bits 4, 5, 6 and 7 are undefined when read. tmra3 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? taff3c1 taff3c0 taff3ie taff3is read/write ? ? ? ? r/w after reset ? ? ? ? 1 1 0 0 function 00: invert ta3ff value (soft inversion). 01: set ta3ff to 1. 10: clear ta3ff to 0. 11: don?t care (these bits are always 11 when read.) controls ta3ff inversion. 0: disable inversion. 1: enable inversion. selects ta3ff inversion signal. 0: tmra2 1: tmra3 0 inverted by tmra2 1 inverted by tmra3 note: ta3ffcr bits 4, 5, 6 and 7 are undefined when read. figure 3.9.12 tmra registers selects the signal which inverts timer flip-flop 1 (ta1ff). (don?t care unless in 8-bit timer mode) selects the signal which inverts timer flip-flop 3 (ta3ff). (don?t care unless in 8-bit timer mode) ta1ffcr (0xffff_f105) ta3ffcr (0xffff_f10d)
tmp1942cy/cz tmp1942cy/cz-179 tmra5 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? taff5c1 taff5c0 taff5ie taff5is read/write ? ? ? ? r/w after reset ? ? ? ? 1 1 0 0 function 00: invert ta5ff value (soft inversion). 01: set ta5ff to 1. 10: clear ta5ff to 0. 11: don?t care (these bits are always 11 when read.) controls ta5ff inversion. 0: disable inversion. 1: enable inversion. selects ta5ff inversion signal. 0: tmra4 1: tmra5 0 inverted by tmra4 1 inverted by tmra5 note: ta5ffcr bits 4, 5, 6 and 7 are undefined when read. tmra7 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? taff7c1 taff7c0 taff7ie taff7is read/write ? ? ? ? r/w after reset ? ? ? ? 1 1 0 0 function 00: invert ta7ff value (soft inversion). 01: set ta7ff to 1. 10: clear ta7ff to 0. 11: don?t care (these bits are always 11 when read.) controls ta7ff inversion. 0: disable inversion. 1: enable inversion. selects ta7ff inversion signal. 0: tmra6 1: tmra7 0 inverted by tmra6 1 inverted by tmra7 note: ta7ffcr bits 4, 5, 6 and 7 are undefined when read. figure 3.9.13 tmra registers selects the signal which inverts timer flip-flop 5 (ta5ff). (don?t care unless in 8-bit timer mode) selects the signal which inverts timer flip-flop 7 (ta7ff). (don?t care unless in 8-bit timer mode) ta5ffcr (0xffff_f115) ta7ffcr (0xffff_f11d)
tmp1942cy/cz tmp1942cy/cz-180 tmra9 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? taff9c1 taff9c0 taff9ie taff9is read/write ? ? ? ? r/w after reset ? ? ? ? 1 1 0 0 function 00: invert ta9ff value (soft inversion). 01: set ta9ff to 1. 10: clear ta9ff to 0. 11: don?t care (these bits are always 11 when read.) controls ta9ff inversion. 0: disable inversion. 1: enable inversion. selects ta9ff inversion signal. 0: tmra8 1: tmra9 0 inverted by tmra8 1 inverted by tmra9 note: ta9ffcr bits 4, 5, 6 and 7 are undefined when read. tmrab flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? taffbc1 taffbc0 taffbie taffbis read/write ? ? ? ? r/w after reset ? ? ? ? 1 1 0 0 function 00: invert tabff value (soft inversion). 01: set tabff to 1. 10: clear tabff to 0. 11: don?t care (these bits are always 11 when read.) controls tabff inversion. 0: disable inversion. 1: enable inversion. selects tabff inversion signal. 0: tmraa 1: tmrab 0 inverted by tmraa 1 inverted by tmrab note: tabffcr bits 4, 5, 6 and 7 are undefined when read. figure 3.9.14 tmra registers selects the signal which inverts timer flip-flop 9 (ta9ff). (don?t care unless in 8-bit timer mode) selects the signal which inverts timer flip-flop b (tabff). (don?t care unless in 8-bit timer mode) ta9ffcr (0xffff_f125) tabffcr (0xffff_f12d)
tmp1942cy/cz tmp1942cy/cz-181 3.9.4 functional description for each mode (1) 8-bit timer mode tmra0 and tmra1 can be used as 8-bit interval timers independently of each other. you must stop tmra0 and tmra1 before attempting to set their functions or count data. a. generating interrupts periodically the following description uses tmra1 as an e ample. to generate a tram1 interrupt, intta1, at certain intervals, first stop timer 1 and set the operating mode, input clock and cycle in the ta01mod and ta1reg registers. ne t, enable the intta1 interrupt and start timer 1. e ample: to generate intta1 interrupts every 20 s with fc = 32 mhz, set the registers in the following sequence: * clock conditions system clock: high-speed (fc) prescaler clock: fperiph/4 (fperiph = fsys) msb lsb 7 6 5 4 3210 ta01run ? ? x x ? ? 0 ? stop tmra1 and clear it to 0. ta01mod 0 0 x x 10xx select 8-bit timer mode and set input clock to t1 (0.25 s resolution, fc = 32 mhz). ta1reg 0 1 0 1 0000 write 20 s/ t1 = 80 (50h) to ta1reg. imc5lh x x 1 1 0101 enable intta1 and set interrupt level = 5 and rising edge detection. ta01run ? x x x ? 11 ? start tmra1. note: x = don?t care; ??? = no change for a description of input clock selection, refer to table 3.9.3. note: the input clocks for tmra0 and tmra1 differ as shown below. tmra0: ta0in pin input, t1, t4 or t16 tmra1: tmra0 match detection signal, t1, t16 or t256
tmp1942cy/cz tmp1942cy/cz-182 b. outputting a 50% duty cycle square wave invert the value of timer flip-flop ta1ff at certain intervals and forward the inverted value to the timer flip-flop output pin, ta1out. e ample: to output a 1.5- s cycle square wave with fc = 32 mhz on the ta1out pin, set each register in the following sequence. in this e ample tmra1 is used to show how to set the registers, although either tmra0 or tmra1 may be used. * clock conditions system clock: high-speed (fc) high-speed clock gear: 1 (fc) prescaler clock: fperiph/4 (fperiph = fsys) 7 6 5 4 3210 ta01run ? x x x ? ? 0 ? stop tmra1 and clear it to 0. ta01mod 0 0 x x 0 1 ? ? select 8-bit timer mode and set input clock to t1 (0.25 s resolution, fc = 32 mhz). ta1reg 0 0 0 0 0011 write (1.5 s/ t1)/2 = 3 to ta1reg. ta1ffcr x x x x 1011 clear ta1ff to 0 and set it to be cleared by match detection signal from tmra1. p7cr ? ? ? ? ? ? 1 ? p7fc ? ? ? ? ? ? 1 ? set pa6 to ta1out output pin. ta01run ? x x x ? 11 ? start tmra1. note: x = don?t care; ??? = no change figure 3.9.15 square wave out put timing (50% duty cycle) c. using a match signal from tmra0 to make tmra1 count select 8-bit timer mode and set the tmra1 input clock to the tmra0 comparator output. figure 3.9.16 tmra1 counting based on tmra0 0.75 s @fc = 32 mhz bit7 2 t1 intta1 up-counter clea r ta1ff bit0 bit1 ta01run up-count e r comparator timing comparator output (match detection) ta1out 0 1 1 1 2 2 2 3 3 3 0 00 34 51 1 22 33 45 2 tmra1 up-counter (when ta1reg =2) tmra0 up-counter (when ta0reg =5) 1 12 1 comparator tmra0 match output tmra1 match output
tmp1942cy/cz tmp1942cy/cz-183 (2) 16-bit timer mode tmra0 and tmra1 can be used together as a 16-bit interval timer. to select 16-bit timer mode, set ta01mod to 01. in 16-bit timer mode, the tmra1 input clock is derived from the tmra0 overflow output regardless of the ta01mod settings. for a description of tmra1 input clock selection, refer to table 3.9.3. set the timer interrupt cycle in the timer regi sters ta0reg and ta1reg by writing the eight low-order bits to ta0reg and the eight high-order bits to ta1reg. always set ta0reg first. this is because compare operation is temporarily di sabled when data is written to ta0reg; it is re-enabled when data is subsequently written to ta1reg. e ample: to generate intta1 interrupts every 0.2 second with fc = 32 mhz, set the values shown below in the timer registers ta0reg and ta1reg. * clock conditions system clock: high-speed (fc) high-speed clock gear: 1 (fc) prescaler clock: fperiph/4 (fperiph = fsys) with t16 (= 4.0 s at 32 mhz) used as the input clock, 0.2 s/4.0 s = 50000 = c350h therefore, ta1reg must be set to 03h and ta0reg to 50h. a tmra0 comparator output is generated each time the up-counter uc0 and timer register ta0reg match (the up-counter uc0 is not cleared). in this case intta0 is not generated. the tmra1 comparator outputs a match detecti on signal at each comparator timing when the up-counter uc1 and timer register ta1reg match. if the comparators in both tmra0 and tmra1 output a match detection signal at the same time, the up-counters uc0 and uc1 will be cleared to 0 and an intta1 interrupt is generated. also, if in version is enabled, the value of timer flip-flop ta1ff will be inverted. e ample: ta1reg = 04h and ta0reg = 80h figure 3.9.17 timer output in 16-bit timer mode 0080h 0180h 0280h 0380h 0480h up-counter values ( uc1 and uc0 ) invert match detection signal from tmra0 com p arato r interrupt intta1 0000h timer output ta1out
tmp1942cy/cz tmp1942cy/cz-184 (3) 8-bit ppg (programmable square wave) output mode a square wave of any frequency with any duty cycle can be output using tmra0. either low-active or high-active out put pulses can be selected. tmra1 cannot be used in this mode. the square wave is forwarded to ta1out (shared with pa6). figure 3.9.18 8-bit ppg output waveform this mode is used to output a programmable square wave by inverting the timer output every time the 8-bit up-counter uc0 matches the timer registers ta0reg and ta1reg. however, the condition (ta0reg set value) < (ta1reg set value) must be satisfied. although the up-counter uc1 of tmra1 cannot be used in this mode, ta01run must be set to 1 to enable tmra1 counting. figure 3.9.19 shows a block diagram of 8-bit ppg output mode. figure 3.9.19 8-bit ppg o utput mode block diagram t ta0reg and up-counter 0 match (generating intta0) t h t l ta0reg ta1reg ta1reg and up-counter 0 match (generating intta1) ta1out selector t1 shift trigger t4 t16 ta01run 8-bit up-counter (uc 0) comparator comparator ta0reg register buffer ta01run ta1reg internal data bus ta1ff intta0 intta1 invert ta01mod selector ta1ffcr ta0reg-wr ta1out
tmp1942cy/cz tmp1942cy/cz-185 if ta0reg has its double-buffer enabled in this m ode, the value in the register buffer is shifted into ta0reg when ta1reg and uc0 match. if it is necessary to change the duty cycle, using the double-buffer facilitates satisfying the requirements for small duty cycle waveforms. figure 3.9.20 register buffer operation e ample: to output a 1/4 duty cycl e 50-khz pulse (fc = 32 mhz) * clock conditions system clock: high-speed (fc) high-speed clock gear: 1 (fc) prescaler clock: fperiph/4 (fperiph = fsys) calculate the values to be set in the timer registers as follows: to obtain a frequency of 50 khz, generate a waveform with a period t = 1/50 khz = 20 s. when t1 = 0.25 s (at fc = 32 mhz), 20 s/0.25 s = 80 therefore, ta1reg must be set to 80 (= 50h). ne t, to obtain a 1/4 duty cycle, using the formula t 1/4 = 20 s 1/4 = 5 s, 5 s/0.25 s = 20 therefore, ta0reg must be set to 20 (= 14h). 7 6 5 4 3210 ta01run 0 x x x ? 000 stop tmra0 and tmra1 and clear them to 0. ta01mod 1 0 x x xx01 select 8-bit ppg mode and set input clock to t1. ta0reg 0 0 0 1 0100 write 14h. ta1reg 0 1 0 1 0000 write 50h. ta1ffcr x x x x 011x set ta1ff and enable inversion. if these bits are set to 10, lo w-active output waveform will be obtained. p7cr ? ? ? ? ? ? 1 ? p7fc ? ? ? ? ? ? 1 ? set pa6 to ta1out output pin. ta01run 1 x x x ? 111 start tmra0 and tmra1. note: x = don?t care; ??? = no change shift to register buffer ta0reg and up- counter 0 match ta1reg and up- counter 0 match ta0reg (compare value) register buffe r (up-counter = q 1 ) q 1 write to ta0reg (register buffer) (up-counter = q 2 ) q 2 q 2 q 3 20 s
tmp1942cy/cz tmp1942cy/cz-186 (4) 8-bit pwm output mode this mode, only available for tmra0, can output pwm pulses with up to 8-bit resolution. pwm output is forwarded to the ta1out pin (shared with pa6). in this mode tmra1 can be used as an 8-bit timer. timer output is inverted when the up-counter uc0 and the value set in the timer register ta0reg match. it is also inverted when a 2 n -1 counter overflow occurs (n = 6, 7 or 8 as specified in ta01mod). the up-counter uc0 is cleared to 0 upon the occurrence of a 2 n -1 counter overflow. before pwm mode can be used, the following conditions must be satisfied: (ta0reg set value) < (2 n -1 counter overflow set value) (ta0reg set value) 0 figure 3.9.21 8-bit pwm output waveform figure 3.9.22 shows a block diagram of 8-bit pwm output mode. figure 3.9.22 8-bit pwm output mode block diagram ta01mod ta1ffcr internal data bus shift trigger clear 8-bit up-counter (uc 0) ta01run selector t1 t4 t16 ta1ff ta1out comparator ta0reg register buffer selector ta01run invert ta0reg-wr intta0 ta01mod overflow 2 n -1 overflow control ta1out 2 n -1 overflow (intta0 interrupt) t pwm (pwm cycle) ta0reg and up-counter 0 match
tmp1942cy/cz tmp1942cy/cz-187 if ta0reg has its double-buffer enabled in this m ode, the value in the register buffer is shifted into ta0reg upon the detection of a 2 n -1 overflow. using the double-buffer facilitates satisfying the requirements for small duty cycle waveforms. figure 3.9.23 register buffer operation e ample: to output the following pwm wavefo rm on the ta1out pin using tmra0 when fc = 32 mhz * clock conditions system clock: high-speed (fc) high-speed clock gear: 1 (fc) prescaler clock: fperiph/4 (fperiph = fsys) to achieve a pwm cycle of 31.75 s with t1 = 0.25 s (at fc = 32 mhz), the following equation must be satisfied: 31.75 s/0.25 s = 127 = 2 n -1 therefore, n must be set to 7. since the low-level period is 18 s and t1 = 0.25 s, 18 s/0.25 s = 72 = 48h therefore, ta0reg must be set to 48h. msb lsb 7 6 5 4 3210 ta01run ? x x x ? ? ? 0 stops tmra0 and clear it to 0. ta01mod 1 1 1 0 ? ? 01 select 8-bit pwm mode (cycle = 2 7 -1) and set input clock to t1. ta0reg 0 1 0 0 1000 write 48h. ta1ffcr x x x x 101x clear ta1ff and enable inversion. p7cr ? ? ? ? ? ? 1 ? p7fc ? ? ? ? ? ? 1 ? set pa6 to ta1out output pin. ta01run 1 x x x ? 1 ? 1 start tmra0. note: x = don?t care; ??? = no change q 2 up-counter = q 2 up-counter = q 1 q 1 q 2 q 3 shift to ta0reg ta0reg and up-counter 0 match 2 n -1 overflo w ta0reg (compare value) register buffe r write to ta0reg (register buffer) 18 s 31.75 s
tmp1942cy/cz tmp1942cy/cz-188 table 3.9.4 pwm periods @fc = 32 mhz pwm period 2 6 ? 1 2 7 ? 1 2 8 ? 1 peripheral clock selection clock gear value selected prescaler clock t1 t4 t16 t1 t4 t16 t1 t4 t16 00 (fperiph/4) 15.8 s 63 s 252 s 31.8 s 127 s 508 s 63.8 s 255 s 1020 s 01 (fperiph/2) 7.9 s 31.5 s 126 s 15.9 s 63.5 s 254 s 31.9 s 127.5 s 510 s 00 (fc) 10 (fperiph) ? 15.8 s 63 s ? 31.8 s 127 s ? 63.8 s 255 s 00 (fperiph/4) 31.5 s 126 s 504 s 63.5 s 254 s 1016 s 127.5 s 510 s 2040 s 01 (fperiph/2) 15.8 s 63 s 252 s 31.8 s 127 s 508 s 63.8 s 255 s 1020 s 01 (fc/2) 10 (fperiph) ? 31.5 s 126 s ? 63.5 s 254 s ? 127.5 s 510 s 00 (fperiph/4) 63 s 252 s 1008 s 127 s 508 s 2032 s 255 s 1020 s 4080 s 01 (fperiph/2) 31.5 s 126 s 504 s 63.5 s 254 s 1016 s 127.5 s 510 s 2040 s 10 (fc/4) 10 (fperiph) ? 63 s 252 s ? 127 s 508 s ? 255 s 1020 s 00 (fperiph/4) 126 s 504 s 2016 s 254 s 1016 s 4064 s 510 s 2040 s 8160 s 01 (fperiph/2) 63 s 252 s 1008 s 127 s 508 s 2032 s 255 s 1020 s 4080 s 0 (fgear) 11 (fc/8) 10 (fperiph) ? 126 s 504 s ? 254 s 1016 s ? 510 s 2040 s 00 (fperiph/4) 15.8 s 63 s 252 s 31.8 s 127 s 508 s 63.8 s 255 s 1020 s 01 (fperiph/2) 7.9 s 31.5 s 126 s 15.9 s 63.5 s 254 s 31.9 s 127.5 s 510 s 00 (fc) 10 (fperiph) ? 15.8 s 63 s ? 31.8 s 127 s ? 63.8 s 255 s 00 (fperiph/4) 15.8 s 63 s 252 s 31.8 s 127 s 508 s 63.8 s 255 s 1020 s 01 (fperiph/2) ? 31.5 s 126 s ? 63.5 s 254 s ? 127.5 s 510 s 01 (fc/2) 10 (fperiph) ? 15.8 s 63 s ? 31.8 s 127 s ? 63.8 s 255 s 00 (fperiph/4) ? 63 s 252 s ? 127 s 508 s ? 255 s 1020 s 01 (fperiph/2) ? 31.5 s 126 s ? 63.5 s 254 s ? 127.5 s 510 s 10 (fc/4) 10 (fperiph) ? ? 63 s ? ? 127 s ? ? 255 s 00 (fperiph/4) ? 63 s 252 s ? 127 s 508 s ? 255 s 1020 s 01 (fperiph/2) ? ? 126 s ? ? 254 s ? ? 510 s 1 (fc) 11 (fc/8) 10 (fperiph) ? ? 63 s ? ? 127 s ? ? 255 s note 1: the prescaler?s output clock tn must be selected such that the relationship tn < fsys/2 is satisfied (i.e., tn must be slower than fsys/2). note 2: do not change the clock gear value while the timer is running. note 3: the ? character means ?don?t use?.
tmp1942cy/cz tmp1942cy/cz-189 (5) summary of operating mode settings table 3.9.5 summarizes the settings for tmra01 for each mode. t able 3.9.5 regi ster settings for each timer mode register name ta01mod ta1ffcr register field name taff1is function timer mode pwm period high-order timer input clock low-order time r input clock timer f/f inverting signal selection 8-bit timer 2 channels 00 ? low-order timer match, t1, t16, t256 (00, 01, 10, 11) e ternal, t1, t4, t16 (00, 01, 10, 11) 0: low-order timer output 1: high-order timer output 16-bit timer mode 01 ? ? e ternal, t1, t4, t16 (00, 01, 10, 11) ? 8-bit ppg 1 channel 10 ? ? e ternal, t1, t4, t16 (00, 01, 10, 11) ? 8-bit pwm 1 channel 8-bit timer 1 channel (note) 11 2 6 ? 1, 2 7 ? 1, 2 8 ? 1 (01, 10, 11) t1, 16, t256 (01, 10, 11) e ternal, t1, t4, t16 (00, 01, 10, 11) pwm output ??? = don?t care note: in 8-bit pwm generation mode, the uc1 can be used as an 8-bit timer. however, the match-detect output from the uc0 can not be used as a clock source for the uc1, and the timer output is not available for the uc1.
tx1942cy/cz 3. 3.10 16-bit timers/event counters (tmrbn) the tmp1942 contains fourteen multi-function 16-b it timer/event counter channels (tmrb0-tmrbd). tmrbn can operate in the following four modes: ? 16-bit interval timer mode ? 16-bit event counter mode ? 16-bit programmable square wave output (ppg) mode ? 2-phase pulse input counter mode (only for tmrb2 and tmrb3) in addition, when used in combination with the capture function, tmrbn can be run in the following modes: ? frequency measurement mode ? pulse width measurement mode ? time difference measurement mode each channel consists primarily of a 16-bit up-counter , two 16-bit timer registers (one with a double-buffer structure), two 16-bit capture register s, two comparators, capture input co ntroller, and a timer flip-flop with accompanying control circuit. timer operating modes an d flip-flops are controlled by eleven registers. all channels tmrb0 to tmrbd oper ate independently of each other. because each channel functions the same way except for the 2-phase pulse counter function and a few other differences as shown in tables 3.10.1 to 3.10.2, operation of the tmrb0 only is described here, with an explanation of the 2-phase pulse counter function for tmrb2 and tmrb3. table 3.10.1 specification differences among the tmrb channels channel specification tmrb0 tmrb1 tmrb2 tmrb3 external clock/ capture trigger input pins tb0in0 (shared with pa0) tb0in1 (shared with pa1) tb1in0 (shared with pa3) tb1in1 (shared with pa4) tb2in0 (shared with pb0) tb2in1 (shared with pb1) tb3in0 (shared with pb3) tb3in1 (shared with pb4) capture trigger timer ta3out ta3out ta3out ta3out external pins timer flip-flop output pin tb0out (shared with pa2) tb1out (shared with pa5) tb2out (shared with pb2) tb3out (shared with pb5) timer run register tb0run (0xffff_f140) tb1run (0 xffff_f150) tb2run (0xffff_f160) tb3run (0xffff_f170) timer mode register tb0mod (0xffff_ f142) tb1mod (0xffff_f152) tb2mod (0xffff_f162) tb3mod (0xffff_f172) timer flip-flop control register tb0ffcr (0xffff_f143) tb1ffcr (0xffff_f153) tb2ffcr(0xffff_f163) tb3ffcr (0xffff_f173) timer registers tb0rg0l (0xffff_f148) tb0rg0h (0xffff_f149) tb0rg1l (0xffff_f14a) tb0rg1h (0xffff_f14b) tb1rg0l (0xffff_f158) tb1rg0h (0xffff_f159) tb1rg1l (0xffff_f15a) tb1rg1h (0xffff_f15b) tb2rg0l (0xffff_f168) tb2rg0h (0xffff_f169) tb2rg1l (0xffff_f16a) tb2rg1h (0xffff_f16b) tb3rg0l (0xffff_f178) tb3rg0h (0xffff_f179) tb3rg1l (0xffff_f17a) tb3rg1h (0xffff_f17b) register name (address) capture registers tb0cp0l (0xffff_f14c) tb0cp0h (0xffff_f14d) tb0cp1l (0xffff_f14e) tb0cp1h (0xffff_f14f) tb1cp0l (0xffff_f15c) tb1cp0h (0xffff_f15d) tb1cp1l (0xffff_f15e) tb1cp1h (0xffff_f15f) tb2cp0l (0xffff_f16c) tb2cp0h (0xffff_f16d) tb2cp1l (0xffff_f16e) tb2cp1h (0xffff_f16f) tb3cp0l (0xffff_f17c) tb3cp0h (0xffff_f17d) tb3cpil (0xffff_f17e) tb3cpih (0xffff_f17f) tmp1942cy/cz-190
tx1942cy/cz table 3.10.2 specification differences among the tmrb channels channel specification tmrb4 tmrb5 tmrb6 tmrb7 external clock/ capture trigger input pins tb4in0 (shared with pb2) tb4in1 (shared with pb5) ? ? tb4in0 (shared with p95) tb4in1 (shared with p96) capture trigger timer ta3out ta3out ta3out ta3out external pins timer flip-flop output pin tb4out (shared with p92) tb5out (shared with p93) tb6out (shared with p94) tb7out (shared with p97) timer run register tb4run (0xffff_f180) tb5run (0 xffff_f190) tb6run (0xffff_f1 a0) tb7run (0xffff_f1b0) timer mode register tb4mod (0xffff_ f182) tb5mod (0xffff_f192) tb6mod (0xffff_f1a2) tb7mod (0xffff_f1b2) timer flip-flop control register tb4ffcr (0xffff_f183) tb5ffcr (0xffff_f193) tb 6ffcr(0xffff_f1a3) tb7ffcr (0xffff_f1b3) timer registers tb4rg0l (0xffff_f188) tb4rg0h (0xffff_f189) tb4rg1l (0xffff_f18a) tb4rg1h (0xffff_f18b) tb5rg0l (0xffff_f198) tb5rg0h (0xffff_f199) tb5rg1l (0xffff_f19a) tb5rg1h (0xffff_f19b) tb6rg0l (0xffff_f1a8) tb6rg0h (0xffff_f1a9) tb6rg1l (0xffff_f1aa) tb6rg1h (0xffff_f1ab) tb7rg0l (0xffff_f1b8) tb7rg0h (0xffff_f1b9) tb7rg1l (0xffff_f1ba) tb7rg1h (0xffff_f1bb) register name (address) capture registers tb4cp0l (0xffff_f18c) tb4cp0h (0xffff_f18d) tb4cp1l (0xffff_f18e) tb4cp1h (0xffff_f18f) tb5cp0l (0xffff_f19c) tb5cp0h (0xffff_f19d) tb5cp1l (0xffff_f19e) tb5cp1h (0xffff_f19f) tb6cp0l(0xffff_f1ac) tb6cp0h(0xffff_f1ad) tb6cp1l (0xffff_f1ae) tb6cp1h (0xffff_f1af) tb7cp0l (0xffff_f1bc) tb7cp0h(0xffff_f1bd) tb7cpil (0xffff_f1be) tb7cpih (0xffff_f1bf) table 3.10.3 specification differences among the tmrb channels channel specification tmrb8 tmrb9 tmrba tmrbb external clock/ capture trigger input pins tb8in0 (shared with pc6) tb8in1 (shared with pc7) tb9in0 (shared with pd0) tb8in1 (shared with pd1) tbain0 (shared with pd5) tbain1 (shared with pd6) ? capture trigger timer ta5out ta5out ta5out ta5out external pins timer flip-flop output pin ? ? ? ? timer run register tb8run (0xffff_ f1c0) tb9run (0xffff_f1d0) tbarun (0 xffff_f1e0) tbbrun (0xffff_f1f0) timer mode register tb8mod (0xffff_f1c2) tb9mod (0x ffff_f1d2) tbamod (0xffff_f1e2) tbbmod (0xffff_f1f2) timer flip-flop control register ? ? ? ? timer registers tb8rg0l (0xffff_f1c8) tb8rg0h (0xffff_f1c9) tb8rg1l (0xffff_f1ca) tb8rg1h (0xffff_f1cb) tb9rg0l (0xffff_f1d8) tb9rg0h (0xffff_f1d9) tb9rg1l (0xffff_f1da) tb9rg1h (0xffff_f1db) tbarg0l (0xffff_f1e8) tbarg0h (0xffff_f1e9) tbarg1l (0xffff_f1ea) tbarg1h (0xffff_f1eb) tbbrg0l (0xffff_f1f8) tbbrg0h (0xffff_f1f9) tbbrg1l (0xffff_f1fa) tbbrg1h (0xffff_f1fb) register name (address) capture registers tb8cp0l (0xffff_f1cc) tb8cp0h (0xffff_f1cd) tb8cp1l (0xffff_f1ce) tb8cp1h (0xffff_f1cf) tb9cp0l (0xffff_f1dc) tb9cp0h (0xffff_f1dd) tb9cp1l (0xffff_f1de) tb9cp1h (0xffff_f1df) tbacp0l (0xffff_f1ec) tbacp0h (0xffff_f1ed) tbacp1l (0xffff_f1ee) tbacp1h (0xffff_f1ef) tbbcp0l (0xffff_f1fc) tbbcp0h (0xffff_f1fd) tbbcpil (0xffff_f1fe) tbbcpih (0xffff_f1ff) tmp1942cy/cz-191
tx1942cy/cz table 3.10.4 specification differences among the tmrb channels channel specification tmrbc tmrbd external clock/ capture trigger input pins capture trigger timer ta5out ta5out external pins timer flip-flop output pin timer run register tbcrun (0xffff_f200) tbdrun (0xffff_f210) timer mode register tbcmod (0xffff_f202) tbdmod (0xffff_f212) timer flip-flop control register timer registers tbcrg0l (0xffff_f208) tbcrg0h (0xffff_f209) tbcrg1l (0xffff_f20a) tbcrg1h (0xffff_f20b) tbdrg0l (0xffff_f218) tbdrg0h (0xffff_f219) tbdrg1l (0xffff_f21a) tbdrg1h (0xffff_f21b) register name (address) capture registers tbccp0l (0xffff_f20c) tbccp0h (0xffff_f20d) tbccp1l (0xffff_f20e) tbccp1h (0xffff_f20f) tbdcp0l (0xffff_f21c) tbdcp0h (0xffff_f21d) tbdcp1l (0xffff_f21e) tbdcp1h (0xffff_f21f) tmp1942cy/cz-192
tx1942cy/cz 3.10.1 block diagrams internal data bus internal data bus run/ clear match detect 16-bit comparator ( cp0 ) 16-bit timer register tb0rg0h/l 16-bit comparator ( cp1 ) register buffer 0 16-bit timer register tb0rg1h/l match detect counter clock tb0mod tb0run selector tb0mod prescaler clock source: t0 ta3out tb0in0 tb0in1 t0 t2 t8 tb0run tb0mod (from tmra23) capture register 0 tb0cp0h/l tb0mod capture egister 1 tb0cp1h/l 16 8 4 2 t2 t8 tb0run internal data bus internal data bus timer flip flop control tb0ff0 timer flip flop tb0out tmrb0 interrupt inttb0 timer flip flop output over-flow iinterru p t out p ut capture & external control 16-bit up-counter (uc0) 16-bit timer status register tb0st re g ister 0 interru p t out p ut re g ister 1 interru p t out p ut figure 3.10.1 tmrb0/1 and tm rb to tmrbd block diagram tmp1942cy/cz-193
tx1942cy/cz internal data bus internal data bus run/ clear match detect 16-bit comperator ( cp0 ) 16-bit timer register tb2rg0h/l 16-bit comparator (cp1) register buffer 0 16-bit timer register tb2rg1h/l match detect count clock tb2mod tb2run selector tb2mod prescaler clock source: t0 ta3out tb2in0 tb2in1 t0 t2 t8 tb2run tb2mod (from tmra23) capture register 0 tb2cp0h/l tb2mod capture register 1 tb2cp1h/l 16 8 4 2 t2 t8 tb2run internal data bus internal data bus timer flip flop control tb2ff0 timer flip flop tb2out tmrb2 interrupt inttb2 timer flip flop control output over flow interru p t out p ut capture & external interrupt 16-bit up down counter (uc0) 16-bit timer status register tb2st re g ister 0 interru p t out p ut re g ister 1 interru p t out p ut up-down control tb2run tx1942cy/cz 3.10.2 function description of each circuit (1) prescaler the tmp1942 has a 5-bit prescal er to supply a clock to tmrb0. the prescaler?s input clock t0 has a frequency of fperiph, fperiph/2, or fperiph/4 as selected by syscr0 in the cg block. fperiph is either the clock fgear as selected by syscr1 in the cg block or the clock fc before division by the clock gear. the prescaler is set to either run or stop by ta01run. writing a 1 to this bit causes the prescaler to start counting and writing 0 causes it to clear itself and stop counting. table 3.10.5 table 3.10.5 prescaler output clock resolutions shows the resolutions of th e prescaler output clocks. @fc = 32 mhz prescaler output clock resolution peripheral clock selection clock gear value selected prescaler clock t1 t4 t16 00 (fperiph/4) fc/2 3 (0.25 s) fc/2 5 (1.0 s) fc/2 7 (4.0 s) 01 (fperiph/2) fc/2 2 (0.125 s) fc/2 4 (0.5 s) fc/2 6 (2.0 s) 00 (fc) 10 (fperip) ? fc/2 3 (0.25 s) fc/2 5 (1.0 s) 00 (fperiph/4) fc/2 4 (0.5 s) fc/2 6 (2.0 s) fc/2 8 (8.0 s) 01 (fperiph/2) fc/2 3 (0.25 s) fc/2 5 (1.0 s) fc/2 7 (4.0 s) 01 (fc/2) 10 (fperip) ? fc/2 4 (0.5 s) fc/2 6 (2.0 s) 00 (fperiph/4) fc/2 5 (1.0 s) fc/2 7 (4.0 s) fc/2 9 (16 s) 01 (fperiph/2) fc/2 4 (0.5 s) fc/2 6 (2.0 s) fc/2 8 (8.0 s) 10 (fc/4) 10 (fperip) ? fc/2 5 (1.0 s) fc/2 7 (4.0 s) 00 (fperiph/4) fc/2 6 (2.0 s) fc/2 8 (8.0 s) fc/2 10 (32 s) 01 (fperiph/2) fc/2 5 (1.0 s) fc/2 7 (4.0 s) fc/2 9 (16 s) 0 (fgear) 11 (fc/8) 10 (fperip) ? fc/2 6 (2.0 s) fc/2 8 (8.0 s) 00 (fperiph/4) fc/2 3 (0.25 s) fc/2 5 (1.0 s) fc/2 7 (4.0 s) 01 (fperiph/2) fc/2 2 (0.125 s) fc/2 4 (0.5 s) fc/2 6 (2.0 s) 00 (fc) 10 (fperip) ? fc/2 3 (0.25 s) fc/2 5 (1.0 s) 00 (fperiph/4) fc/2 3 (0.25 s) fc/2 5 (1.0 s) fc/2 7 (4.0 s) 01 (fperiph/2) ? fc/2 4 (0.5 s) fc/2 6 (2.0 s) 01 (fc/2) 10 (fperip) ? fc/2 3 (0.25 s) fc/25 (1.0 s) 00 (fperiph/4) ? fc/2 5 (1.0 s) fc/2 7 (4.0 s) 01 (fperiph/2) ? fc/2 4 (0.5 s) fc/2 6 (2.0 s) 10 (fc/4) 10 (fperip) ? ? fc/2 5 (1.0 s) 00 (fperiph/4) ? fc/2 5 (1.0 s) fc/2 7 (4.0 s) 01 (fperiph/2) ? ? fc/2 6 (2.0 s) 1 (fc) 11 (fc/8) 10 (fperip) ? ? fc/2 5 (1.0 s) note 1: the prescaler?s output clock tn must be selected such that the relationship tn < fsys/2 is satisfied (i.e., tn must be slower than fsys/2). note 2: do not change the clock gear value while the timer is running. note 3: the ? character means ?don?t use?. tmp1942cy/cz-195
tx1942cy/cz (2) up-counter (uc0) uc0 is a 16-bit binary counter which counts up synchronously with the input clock selected by tb0mod. the input clock for uc0 is either the external clock entered via the tb0in0 pin or one of the three prescaler output clocks, t1, t4 or t16. the setting of tb0run either causes the up-counter uc0 to count, or stops and clears it. if the value in the up-counter uc0 matches the value in the timer register tb0rg1h/l while clearing is en abled, uc0 is cleared to 0. clearing of uc0 can be enabled or disabled by setting tb0mod accordingly. if clearing is disabled, the counter functions as a free-running counter. in addition, when uc0 overflows, it generates an overflow interrupt inttb01. tmrb2 and tmrb3 support the 2-phase pulse input counter feature. when 2-phase pulse counter mode is selected with the setting of tb2run, uc0 functions as an up/down-counter with an initial value of 0x7fff. wh en the counter overflows, it is reloaded with an initial value of 0x0000. when the counter underflows , it is reloaded with an initial value of 0xffff. uc0 only functions as an up-counter in other modes. note: programming the tb0clk[1:0] and tb0cle bits in the tb0mod register should only be attempted when the timer is not running. (3) timer registers (tb0rg0h/l and tb0rg1h/l) each channel incorporates two 16-bit registers used to set a counter value. when the value set in one of these timer registers matches the value of up-counter uc0, the comparator?s match detection signal becomes active. timer registers tb0rg0h/l and tb0rg1h/l can be written in a single operation using a 2-byte data transfer instruction, or in two operations (t he eight low-order bits first and then the eight high-order bits) using a 1-byte data transfer instruction. the timer register tb0rg0 has a double-buffer structure, being paired with register buffer 0. the setting of tb0run enables or disables the register?s double-buffer facility. the double-buffer is disabled when = 0 and enabled when = 1. when the double-buffer is enabled, data transfer from register buffer 0 to the timer register tb0rg0 is initiated by a match of uc0 and tb0rg1. when reset, the contents of the timer registers tb0rg0 and tb0rg1 are undefined; hence, data must be written to the timer registers before the 16-bit timers can be used. a reset initializes tb0run to 0, disabling the double-buffer . to use the double-buffer, write data to the timer registers and set to 1, then write the following data in the register buffer. tb0rg0 and its register buffer both have the same addresses, 0xffff_f188 and 0xffff_f189, allocated to them. when = 0, the same value is written to tb0rg0 and its register buffer; when = 1, the value is only writte n to the register buffer. therefore, the register buffer must be disabled before the initial value is written to the timer register. note: programming the tb0rde bit should only be attempted when the timer is not running. tmp1942cy/cz-196
tx1942cy/cz (4) capture registers (tb0cp0h/l and tb0cp1h/l) tb0cp0h/l and tb0cp1h/l are 16-bit registers used to latch the value of the up-counter uc0. data may be read out from a capture register in a single operation using a 2-byte data transfer instruction, or in two operations (the eight low-order bits first and then the eight high-order bits) using a 1-byte data transfer instruction. (5) capture controller this circuit controls the timing at which the value in the up-counter uc0 is latched into the capture registers (tb0cp0 and tb0cp1). the capture register latch timing is set using tb0mod. in addition, the value of the up-counter uc0 can be latched into the capture registers by software. each time tb0mod is set to 0, the uc0 value at that point is latched into tb0cp0. before this function can be used, the prescaler must be placed in the run state by setting tb0run to 1. in 2-phase pulse counter mode (only for tmrb2 and tmrb3), the counter value is latched by software capture. note1: reading the eight low-order bits of the capture register disables capture operation. subsequently reading the eight hi gh-order bits of the capture register enables capture operation. note2: if the timer is stopped when only the ei ght low-order bits have been read, capture operation is not enabled even after the timer is restarted. do not stop the timer until both the eight low-order and eight high-order bits are read. note3: when the tb0in0 pin is selected as a c apture trigger input, it c an not function as a timer clock. (6) comparators (cp0 and cp1) the two 16-bit comparators compare the value of the up-counter uc0 with the values set in the timer registers tb0rg0 and tb0rg1 to detect a match. if the value in either tb0rg0 or tb0rg1 matches the value in uc0, the corresponding comparator generates an inttb0 interrupt. (7) timer flip-flop (tb0ff0) the timer flip-flop tb0ff0 is designed to be inverted by a match detection signal from the comparator or by a latch signal to the capture registers. inversion can be enabled or disabled by setting tb0ffcr accordingly. when reset, the tb0ff0 value is undefined. writing 00 to tb0ffcr inverts the value of the flip-flop; writing 01 to tb0ffcr sets the flip-flop to 1; writing 10 to tb0ffcr clears the flip-flop to 0. the tb0ff0 value can be forwarded to the timer output pin, tb0out (shared with pa2). when timer output is needed, this pin must be set for that purpose by using the port a registers pacr and pafc. note: programming the tb0ff0c1[1:0] field should only be attempted when the timer is not running. tmp1942cy/cz-197
tx1942cy/cz 3.10.3 register description tmrb0 run register 7 6 5 4 3 2 1 0 bit symbol tb0rde ? ? ? i2tb0 tb0prun ? tb0run read/write r/w r/w ? r/w r/w r/w ? r/w after reset 0 0 ? 0 0 0 ? 0 function double buffer 0: disable 1: enable must always be set to 0. must always be set to 0. idle 0: idle 1: operate timer run/stop control 0: stop and cleared 1: count tb0run (0xffff_ f140) i2tb0: operation in idle mode tb0prun: operation of the prescaler tb0run: operation of timer b0 note: tb0run bits 1 and 5 are undefined when read. tmrb1 run register 7 6 5 4 3 2 1 0 bit symbol tb1rde ? ? ? i2tb1 tb1prun ? tb1run read/write r/w r/w ? r/w r/w r/w ? r/w after reset 0 0 ? 0 0 0 ? 0 function double buffer 0: disable 1: enable must always be set to 0. must always be set to 0. idle 0: idle 1: operate 16-bit timer run/stop control 0: stop and cleared 1: count i2tb1: operation in idle mode tb1prun: operation of the prescaler tb1run: operation of timer b1 note: tb1run bits 1 and 5 are undefined when read. tb1run (0xffff_ f150) figure 3.10.3 tmrb registers tmp1942cy/cz-198
tx1942cy/cz tmrb2 run register 7 6 5 4 3 2 1 0 bit symbol tb2rde ? ud2ck tb2udce i2tb2 tb2prun tb2run read/write r/w r/w r/w r/w r/w r/w r/w after reset 0 0 0 0 0 0 0 function double buffer 0: disable 1: enable must always be set to 0. sampling clock 0: fs 1: fsys/2 2-phase counter enable 0: disable 1: enable idle 0: idle 1: operate timer run/stop control 0: stop and cleared 1: count tb2run (0xffff_ f160) i2tb2: operation in idle mode tb2prun: operation of the prescaler tb2run: operation of timer b2 tb2udce: operation of the 2-phase pulse input counter ud2ck: sampling clock selection for 2-phase pulse input note 1: tb2run bits 1 and 5 are undefined when read. note 2: setting tb2run bit 4 to 1 selects 2-phase pulse input counter mode, causing the counter to operate as an up/down-counter. clearing the bit to 0 restores normal timer mode, causing the timer to operate as an up-counter. tmrb3 run register 7 6 5 4 3 2 1 0 bit symbol tb3rde ? ud3ck tb3udce i2tb3 tb3prun ? tb3run read/write r/w r/w r/w r/w r/w r/w ? r/w after reset 0 0 0 0 0 0 ? 0 function double buffer 0: disable 1: enable must always be set to 0. sampling clock 0: fs 1: fsys/2 2-phase counter enable 0: disable 1: enable idle 0: idle 1: operate 16-bit timer run/stop control 0: stop and cleared 1: count i2tb3: operation in idle mode tb3prun: operation of the prescaler tb3run: operation of timer b3 tb3udce: operation of the 2-phase pulse input counter ud3ck: sampling clock selection for 2-phase pulse input note 1: tb3run bits 1 and 5 are undefined when read. note 2: setting tb3run bit 4 to 1 selects 2-phase pulse input counter mode, causing the counter to operate as an up/down-counter. clearing the bit to 0 restores normal timer mode, causing the timer to operate as an up-counter. tb3run (0xffff_ f170) figure 3.10.4 tmrb registers tmp1942cy/cz-199
tx1942cy/cz tmrb4 run register 7 6 5 4 3 2 1 0 bit symbol tb4rde ? ? ? i2tb4 tb4prun ? tb4run read/write r/w r/w ? r/w r/w r/w ? r/w after reset 0 0 ? 0 0 0 ? 0 function double buffer 0: disable 1: enable must always be set to 0. must always be set to 0. idle 0: idle 1: operate 16-bit timer run/stop control 0: stop and cleared 1: count tb4run (0xffff_ f180) i2tb4: operation in idle mode tb4prun: operation of the prescaler tb4run: operation of timer b4 note: tb4run bits 1 and 5 are undefined when read. tmrb5 run register 7 6 5 4 3 2 1 0 bit symbol tb5rde ? ? ? i2tb5 tb5prun ? tb5run read/write r/w r/w ? r/w r/w r/w ? r/w after reset 0 0 ? 0 0 0 ? 0 function double buffer 0: disable 1: enable must always be set to 0. must always be set to 0. idle 0: idle 1: operate 16-bit timer run/stop control 0: stop and cleared 1: count i2tb5: operation in idle mode tb5prun: operation of the prescaler tb5run: operation of timer b5 note: tb5run bits 1 and 5 are undefined when read. tmrb6 run register 7 6 5 4 3 2 1 0 bit symbol tb6rde ? ? ? i2tb6 tb6prun ? tb6run read/write r/w r/w ? r/w r/w r/w ? r/w after reset 0 0 ? 0 0 0 ? 0 function double buffer 0: disable 1: enable must always be set to 0. must always be set to 0. idle 0: idle 1: operate 16-bit timer run/stop control 0: stop and cleared 1: count i2tb6: operation in idle mode tb6prun: operation of the prescaler tb6run: operation of timer b6 note: tb6run bits 1 and 5 are undefined when read. tb5run (0xffff_ f190) tb6run (0xffff_ f1a0) figure 3.10.5 tmrb registers tmp1942cy/cz-200
tx1942cy/cz tmrb7 run register 7 6 5 4 3 2 1 0 bit symbol tb7rde ? ? ? i2tb7 tb7prun ? tb7run read/write r/w r/w ? ? r/w r/w ? r/w after reset 0 0 ? ? 0 0 ? 0 function double buffer 0: disable 1: enable must always be set to 0. must always be set to 0. idle 0: idle 1: operate 16-bit timer run/stop control 0: stop and cleared 1: count tb7run (0xffff_ f1b0) i2tb7: operation in idle mode tb7prun: operation of the prescaler tb7run: operation of timer b7 note: tb7run bits 1 and 5 are undefined when read. tmrb8 run register 7 6 5 4 3 2 1 0 bit symbol tb8rde ? ? ? i2tb8 tb8prun ? tb8run read/write r/w r/w ? ? r/w r/w ? r/w after reset 0 0 ? ? 0 0 ? 0 function double buffer 0: disable 1: enable must always be set to 0. must always be set to 0. idle 0: idle 1: operate 16-bit timer run/stop control 0: stop and cleared 1: count i2tb8: operation in idle mode tb8prun: operation of the prescaler tb8run: operation of timer b8 note: tb8run bits 1 and 5 are undefined when read. tmrb9 run register 7 6 5 4 3 2 1 0 bit symbol tb9rde ? ? ? i2tb9 tb9prun ? tb9run read/write r/w r/w ? ? r/w r/w ? r/w after reset 0 0 ? ? 0 0 ? 0 function double buffer 0: disable 1: enable must always be set to 0. must always be set to 0. idle 0: idle 1: operate 16-bit timer run/stop control 0: stop and cleared 1: count i2tb9: operation in idle mode tb9prun: operation of the prescaler tb9run: operation of timer b9 note: tb9run bits 1 and 5 are undefined when read. tb9run (0xffff_ f1d0) tb8run (0xffff_ f1c0) figure 3.10.6 tmrb registers tmp1942cy/cz-201
tx1942cy/cz tmrba run register 7 6 5 4 3 2 1 0 bit symbol tbarde ? ? ? i2tba tbaprun ? tbarun read/write r/w r/w ? ? r/w r/w ? r/w after reset 0 0 ? ? 0 0 ? 0 function double buffer 0: disable 1: enable must always be set to 0. must always be set to 0. idle 0: idle 1: operate 16-bit timer run/stop control 0: stop and cleared 1: count tbarun (0xffff_ f1e0) i2tba: operation in idle mode tbaprun: operation of the prescaler tbarun: operation of timer ba note: tbarun bits 1 and 5 are undefined when read. tmrbb run register 7 6 5 4 3 2 1 0 bit symbol tbbrde ? ? ? i2tbb tbbprun ? tbbrun read/write r/w r/w ? ? r/w r/w ? r/w after reset 0 0 ? ? 0 0 ? 0 function double buffer 0: disable 1: enable must always be set to 0. must always be set to 0. idle 0: idle 1: operate 16-bit timer run/stop control 0: stop and cleared 1: count i2tbb: operation in idle mode tbbprun: operation of the prescaler tbbrun: operation of timer bb note: tbbrun bits 1 and 5 are undefined when read. tmrbc run register 7 6 5 4 3 2 1 0 bit symbol tbcrde ? ? ? i2tbc tbcprun ? tbcrun read/write r/w r/w ? ? r/w r/w ? r/w after reset 0 0 ? ? 0 0 ? 0 function double buffer 0: disable 1: enable must always be set to 0. must always be set to 0. idle 0: idle 1: operate 16-bit timer run/stop control 0: stop and cleared 1: count i2tbc: operation in idle mode tbcprun: operation of the prescaler tbcrun: operation of timer bc note: tbcrun bits 1 and 5 are undefined when read. tbbrun (0xffff_ f1f0) tbcrun (0xffff_ f200) figure 3.10.7 tmrb registers tmp1942cy/cz-202
tx1942cy/cz tmrbd run register 7 6 5 4 3 2 1 0 bit symbol tbdrde ? ? ? i2tbd tbdprun ? tbdrun read/write r/w r/w ? ? r/w r/w ? r/w after reset 0 0 ? ? 0 0 ? 0 function double buffer 0: disable 1: enable must always be set to 0. must always be set to 0. idle 0: idle 1: operate 16-bit timer run/stop control 0: stop and cleared 1: count i2tbd: operation in idle mode tbdprun: operation of the prescaler tbdrun: operation of timer bd note: tbdrun bits 1 and 5 are undefined when read. tbdrun (0xffff_ f210) figure 3.10.8 tmrb registers tmp1942cy/cz-203
tx1942cy/cz tmp1942cy/cz-204 tmrb0 mode register 7 6 5 4 3 2 1 0 bit symbol ? ? tb0cp0 tb0cpm1 tb0cpm0 tb0cle tb0clk1 tb0clk0 read/write ? w r/w after reset 0 0 1 0 0 0 0 0 function must always be set to 00. software capture control 0: software capture 1: don?t care capture timing 00: disabled 01: tb0in0 tb0in1 10: tb0in0 tb0in0 11: ta3out ta3out up-counter control 0: clearing disabled 1: clearing enabled source clock selection 00: tb0in0 pin input 01: t1 10: t4 11: t16 0 clearing of up-counter disabled 1 up-counter cleared when it matches tb0rg1 capture control 00 capture disabled 01 latches value into tb0cp0 at rise of tb0in0. latches value into tb0cp1 at rise of tb0in1. 10 latches value into tb0cp0 at rise of tb0in0. latches value into tb0cp1 at fall of tb0in0. 11 latches value into tb0cp0 at rise of ta3out. latches value into tb0cp1 at fall of ta3out. 0 latches up-counter value into tb0cp0. 1 don?t care tmrb1 mode register 7 6 5 4 3 2 1 0 bit symbol ? ? tb1cp0 tb1cpm1 tb1cpm0 tb1cle tb1clk1 tb1clk0 read/write r/w w * r/w after reset 0 0 1 0 0 0 0 0 function must always be set to 00. software capture control 0: software capture 1: don?t care capture timing 00: disabled 01: tb1n0 tb1in1 10: tb1in0 tb1in0 11: ta3out ta3out up-counter control 0: clearing disabled 1: clearing enabled source clock selection 00: tb1in0 pin input 01: t1 10: t4 11: t16 0 clearing of up-counter disabled 1 up-counter cleared when it matches tb1rg1 capture control 00 capture disabled 01 latches value into tb1cp0 at rise of tb1in0. latches value into tb1cp1 at rise of tb1in1. 10 latches value into tb1cp0 at rise of tb1in0. latches value into tb1cp1 at fall of tb1in0. 11 latches value into tb1cp0 at rise of ta3out. latches value into tb1cp1 at fall of ta3out. 0 latches up-counter value into tb1cp0. 1 don?t care figure 3.10.9 tmrb registers tb0mod (0xffff_ f142) clearing up-counter (uc0) software capture capture timing tb1mod (0xffff_ f152) clearing up-counter (uc0) software capture capture timing
tx1942cy/cz tmp1942cy/cz-205 tmrb2 mode register 7 6 5 4 3 2 1 0 bit symbol ? ? tb2cp0 tb2cpm1 tb2cpm0 tb2cle tb2clk1 tb2clk0 read/write ? w * r/w after reset 0 0 1 0 0 0 0 0 function must always be set to 00. software capture control 0: software capture 1: don?t care capture timing 00: disabled 01: tb2in0 tb2in1 10: tb2in0 tb2in0 11: ta3out ta3out up-counter control 0: clearing disabled 1: clearing enabled source clock selection 00: tb2in0 pin input 01: t1 10: t4 11: t16 0 clearing of up-counter disabled 1 up-counter cleared when it matches tb2rg1 capture control 00 capture disabled 01 latches value into tb2cp0 at rise of tb2in0. latches value into tb2cp1 at rise of tb2in1. 10 latches value into tb2cp0 at rise of tb2in0. latches value into tb2cp1 at fall of tb2in0. 11 latches value into tb2cp0 at rise of ta3out. latches value into tb2cp1 at fall of ta3out. 0 latches up-counter value into tb2cp0. 1 don?t care tmrb3 mode register 7 6 5 4 3 2 1 0 bit symbol ? ? tb3cp0 tb3cpm1 tb3cpm0 tb3cle tb3clk1 tb3clk0 read/write ? w * r/w after reset 0 0 1 0 0 0 0 0 function must always be set to 00. software capture control 0: software capture 1: don?t care capture timing 00: disabled 01: tb3in0 tb3in1 10: tb3in0 tb3in0 11: ta3out ta3out up-counter control 0: clearing disabled 1: clearing enabled source clock selection 00: tb3in0 pin input 01: t1 10: t4 11: t16 0 clearing of up-counter disabled 1 up-counter cleared when it matches tb3rg1 capture control 00 capture disabled 01 latches value into tb3cp0 at rise of tb3in0. latches value into tb3cp1 at rise of tb3in1. 10 latches value into tb3cp0 at rise of tb3in0. latches value into tb3cp1 at fall of tb3in0. 11 latches value into tb3cp0 at rise of ta3out. latches value into tb3cp1 at fall of ta3out. 0 latches up-counter value into tb3cp0. 1 don?t care figure 3.10.10 tmrb registers tb2mod (0xffff_ f162) clearing up-counter (uc0) software capture capture timing tb3mod (0xffff_ f172) clearing up-counter (uc0) software capture capture timing
tx1942cy/cz tmp1942cy/cz-206 tmrb4 mode register 7 6 5 4 3 2 1 0 bit symbol ? ? tb4cp0 tb4cpm1 tb4cpm0 tb4cle tb4clk1 tb4clk0 read/write ? w * r/w after reset 0 0 1 0 0 0 0 0 function must always be set to 00. software capture control 0: software capture 1: don?t care capture timing 00: disabled 01: tb4in0 tb4in1 10: tb4in0 tb4in0 11: ta3out ta3out up-counter control 0: clearing disabled 1: clearing enabled source clock selection 00: tb4in0 pin input 01: t1 10: t4 11: t16 0 clearing of up-counter disabled 1 up-counter cleared when it matches tb4rg1 capture control 00 capture disabled 01 latches value into tb4cp0 at rise of tb4in0. latches value into tb4cp1 at rise of tb4in1. 10 latches value into tb4cp0 at rise of tb4in0. latches value into tb4cp1 at fall of tb4in0. 11 latches value into tb4cp0 at rise of ta3out. latches value into tb4cp1 at fall of ta3out. 0 latches up-counter value into tb4cp0. 1 don?t care tmrb5 mode register 7 6 5 4 3 2 1 0 bit symbol ? ? tb5cp0 tb5cpm1 tb5cpm0 tb5cle tb5clk1 tb5clk0 read/write ? w * r/w after reset 0 0 1 0 0 0 0 0 function must always be set to 00. software capture control 0: software capture 1: don?t care capture timing 00: disabled 01: setting prohibited 10: setting prohibited 11: ta3out ta3out up-counter control 0: clearing disabled 1: clearing enabled source clock selection 00: setting prohibited 01: t1 10: t4 11: t16 0 clearing of up-counter disabled 1 up-counter cleared when it matches tb5rg1 00 capture disabled 01 capture disabled 10 capture disabled 11 latches value into tb5cp0 at rise of ta3out. latches value into tb5cp1 at fall of ta3out. 0 latches up-counter value into tb5cp0. 1 don?t care figure 3.10.11 tmrb registers tb5mod (0xffff_ f192) clearing up-counter (uc0) software capture capture timing tb4mod (0xffff_ f182) clearing up-counter (uc0) software capture capture timing
tx1942cy/cz tmp1942cy/cz-207 tmrb6 mode register 7 6 5 4 3 2 1 0 bit symbol ? ? tb6cp0 tb6cpm1 tb6cpm0 tb6cle tb6clk1 tb6clk0 read/write ? w * r/w after reset 0 0 1 0 0 0 0 0 function must always be set to 00. software capture control 0: software capture 1: don?t care capture timing 00: disabled 01: setting prohibited 10: setting prohibited 11: ta3out ta3out up-counter control 0: clearing disabled 1: clearing enabled source clock selection 00: setting prohibited 01: t1 10: t4 11: t16 0 clearing of up-counter disabled 1 up-counter cleared when it matches tb6rg1 00 capture disabled 01 capture disabled 10 capture disabled 11 latches value into tb6cp0 at rise of ta3out. latches value into tb6cp1 at fall of ta3out. 0 latches up-counter value into tb6cp0. 1 don?t care tmrb7 mode register 7 6 5 4 3 2 1 0 bit symbol ? ? tb7cp0 tb7cpm1 tb7cpm0 tb7cle tb7clk1 tb7clk0 read/write ? w * r/w after reset 0 0 1 0 0 0 0 0 function must always be set to 00. software capture control 0: software capture 1: don?t care capture timing 00: disabled 01: tb7in0 tb7in1 10: tb7in0 tb7in0 11: ta3out ta3out up-counter control 0: clearing disabled 1: clearing enabled source clock selection 00: tb7in0 pin input 01: t1 10: t4 11: t16 0 clearing of up-counter disabled 1 up-counter cleared when it matches tb7rg1 00 capture disabled 01 latches value into tb7cp0 at rise of tb7in0. latches value into tb7cp1 at rise of tb7in1. 10 latches value into tb7cp0 at rise of tb7in0. latches value into tb7cp1 at fall of tb7in0. 11 latches value into tb7cp0 at rise of ta3out. latches value into tb7cp1 at fall of ta3out. 0 latches up-counter value into tb7cp0. 1 don?t care figure 3.10.12 tmrb registers tb6mod (0xffff_ f1a2) clearing up-counter (uc0) software capture capture timing tb7mod (0xffff_ f1b2) clearing up-counter (uc0) software capture capture timing
tx1942cy/cz tmp1942cy/cz-208 tmrb8 mode register 7 6 5 4 3 2 1 0 bit symbol ? ? tb8cp0 tb8cpm1 tb8cpm0 tb8cle tb8clk1 tb8clk0 read/write ? w * r/w after reset 0 0 1 0 0 0 0 0 function must always be set to 00. software capture control 0: software capture 1: don?t care capture timing 00: disabled 01: tb8in0 tb8in1 10: tb8in0 tb8in0 11: ta5out ta5out up-counter control 0: clearing disabled 1: clearing enabled source clock selection 00: tb8in0 pin input 01: t1 10: t4 11: t16 0 clearing of up-counter disabled 1 up-counter cleared when it matches tb8rg1 00 capture disabled 01 latches value into tb8cp0 at rise of tb8in0. latches value into tb8cp1 at rise of tb8in1. 10 latches value into tb8cp0 at rise of tb8in0. latches value into tb8cp1 at fall of tb8in0. 11 latches value into tb8cp0 at rise of ta5out. latches value into tb8cp1 at fall of ta5out. 0 latches up-counter value into tb8cp0. 1 don?t care tmrb9 mode register 7 6 5 4 3 2 1 0 bit symbol ? ? tb9cp0 tb9cpm1 tb9cpm0 tb9cle tb9clk1 tb9clk0 read/write ? w * r/w after reset 0 0 1 0 0 0 0 0 function must always be set to 00. software capture control 0: software capture 1: don?t care capture timing 00: disabled 01: tb9in0 tb9in1 10: tb9in0 tb9in0 11: ta5out ta5out up-counter control 0: clearing disabled 1: clearing enabled source clock selection 00: tb9in0 pin input 01: t1 10: t4 11: t16 0 clearing of up-counter disabled 1 up-counter cleared when it matches tb9rg1 00 capture disabled 01 latches value into tb9cp0 at rise of tb9in0. latches value into tb9cp1 at rise of tb9in1. 10 latches value into tb9cp0 at rise of tb9in0. latches value into tb9cp1 at fall of tb9in0. 11 latches value into tb9cp0 at rise of ta5out. latches value into tb9cp1 at fall of ta5out. 0 latches up-counter value into tb9cp0. 1 don?t care figure 3.10.13 tmrb registers tb8mod (0xffff_ f1c2) clearing up-counter (uc0) software capture capture timing tb9mod (0xffff_ f1d2) clearing up-counter (uc0) software capture capture timing
tx1942cy/cz tmp1942cy/cz-209 tmrba mode register 7 6 5 4 3 2 1 0 bit symbol ? ? tbacp0 tbacpm1 tbacpm0 t bacle tbaclk1 tbaclk0 read/write ? w * r/w after reset 0 0 1 0 0 0 0 0 function must always be set to 00. software capture control 0: software capture 1: don?t care capture timing 00: disabled 01: tbain0 tbain1 10: tbain0 tbain0 11: ta5out ta5out up-counter control 0: clearing disabled 1: clearing enabled source clock selection 00: tbain0 pin input 01: t1 10: t4 11: t16 0 clearing of up-counter disabled 1 up-counter cleared when it matches tbarg1 00 capture disabled 01 latches value into tbacp0 at rise of tbain0. latches value into tbacp1 at rise of tbain1. 10 latches value into tbacp0 at rise of tbain0. latches value into tbacp1 at fall of tbain0. 11 latches value into tbacp0 at rise of ta5out. latches value into tbacp1 at fall of ta5out. 0 latches up-counter value into tbacp0. 1 don?t care tmrbb mode register 7 6 5 4 3 2 1 0 bit symbol ? ? tbbcp0 tbbcpm1 tbbcpm0 t bbcle tbbclk1 tbbclk0 read/write ? w * r/w after reset 0 0 1 0 0 0 0 0 function must always be set to 00. software capture control 0: software capture 1: don?t care capture timing 00: disabled 01: setting prohibited 10: setting prohibited 11: ta5out ta5out up-counter control 0: clearing disabled 1: clearing enabled source clock selection 00: setting prohibited 01: t1 10: t4 11: t16 0 clearing of up-counter disabled 1 up-counter cleared when it matches tbbrg1 00 capture disabled 01 capture disabled 10 capture disabled 11 latches value into tbbcp0 at rise of ta5out. latches value into tbbcp1 at fall of ta5out. 0 latches up-counter value into tbbcp0. 1 don?t care figure 3.10.14 tmrb registers tbamod (0xffff_ f1e2) clearing up-counter (uc0) software capture capture timing tbbmod (0xffff_ f1f2) clearing up-counter (uc0) software capture capture timing
tx1942cy/cz tmp1942cy/cz-210 tmrbc mode register 7 6 5 4 3 2 1 0 bit symbol ? ? tbccp0 tbccpm1 tbccpm0 tbccle tbcclk1 tbcclk0 read/write ? w * r/w after reset 0 0 1 0 0 0 0 0 function must always be set to 00. software capture control 0: software capture 1: don?t care capture timing 00: disabled 01: setting prohibited 10: setting prohibited 11: ta5out ta5out up-counter control 0: clearing disabled 1: clearing enabled source clock selection 00: setting prohibited 01: t1 10: t4 11: t16 0 clearing of up-counter disabled 1 up-counter cleared when it matches tbcrg1 00 capture disabled 01 capture disabled 10 capture disabled 11 latches value into tbccp0 at rise of ta5out. latches value into tbccp1 at fall of ta5out. 0 latches up-counter value into tbccp0. 1 don?t care tmrbd mode register 7 6 5 4 3 2 1 0 bit symbol ? ? tbdcp0 tbdcpm1 tbdcpm0 tbdcle tbdclk1 tbdclk0 read/write w * r/w after reset 0 0 1 0 0 0 0 0 function must always be set to 00. software capture control 0: software capture 1: don?t care capture timing 00: disabled 01: disabled 10: disabled 11: ta5out ta5out up-counter control 0: clearing disabled 1: clearing enabled source clock selection 00: setting prohibited 01: t1 10: t4 11: t16 0 clearing of up-counter disabled 1 up-counter cleared when it matches tbdrg1 00 capture disabled 01 capture disabled 10 capture disabled 11 latches value into tbdcp0 at rise of ta5out. latches value into tbdcp1 at fall of ta5out. 0 latches up-counter value into tbdcp0. 1 don?t care figure 3.10.15 tmrb registers tbcmod (0xffff_ f202) clearing up-counter (uc0) software capture capture timing clearing up-counter (uc0) software capture capture timing tbdmod (0xffff_ f212)
tx1942cy/cz tmp1942cy/cz-211 tmrb0 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ? ? tb0c1t1 tb0c0t1 tb0e1t1 tb0e0t1 tb0ff0c1 tb0ff0c0 read/write w * r/w w * after reset 1 1 0 0 0 0 1 1 tb0ff0 inversion trigger 0: trigger disabled 1: trigger enabled function must always be set to 11. * these bits are always 11 when read. when up-counter value is latched into tb0cp1 when up-counter value is latched into tb0cp0 when up-counter and tb0rg1 values match when up-counter and tb0rg0 values match tb0ff0 control 00: invert 01: set 10: clear 11: don?t care * these bits are always 11 when read. 00 tb0ff0 value inverted (soft inversion) 01 tb0ff0 set to 1 10 tb0ff0 set to 0 11 don?t care (read as 11) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) figure 3.10.16 tmrb registers tb0ffcr (0xffff_ f143) control of timer flip-flop (tb0ff0) trigger for inverting timer flip-flop (tb0ff0) when up-counter and tb0rg0 values match trigger for inverting timer flip-flop (tb0ff0) when up-counter and tb0rg1 values match trigger for inverting timer flip-flop (tb0ff0) when up-counter value is latched into tb0cp0 trigger for inverting timer flip-flop (tb0ff0) when up-counter value is latched into tb0cp1
tx1942cy/cz tmp1942cy/cz-212 tmrb1 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ? ? tb1c1t1 tb1c0t1 tb1e1t1 tb1e0t1 tb1ff0c1 tb1ff0c0 read/write w * r/w w * after reset 1 1 0 0 0 0 1 1 tb1ff0 inversion trigger 0: trigger disabled 1: trigger enabled function must always be set to 11. * these bits are always 11 when read. when up-counter value is latched into tb1cp1 when up-counter value is latched into tb1cp0 when up-counter and tb1rg1 values match when up-counter and tb1rg0 values match tb1ff0 control 00: invert 01: set 10: clear 11: don?t care * these bits are always 11 when read. 00 tb1ff0 value inverted (soft inversion) 01 tb1ff0 set to 1 10 tb1ff0 set to 0 11 don?t care (read as 11) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) figure 3.10.17 tmrb registers tb1ffcr (0xffff_ f153) control of timer flip-flop (tb1ff0) trigger for inverting timer flip-flop (tb1ff0) when up-counter and tb1rg0 values match trigger for inverting timer flip-flop (tb1ff0) when up-counter and tb1rg1 values match trigger for inverting timer flip-flop (tb1ff0) when up-counter value is latched into tb1cp0 trigger for inverting timer flip-flop (tb1ff0) when up-counter value is latched into tb1cp1
tx1942cy/cz tmp1942cy/cz-213 tmrb2 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ? ? tb2c1t1 tb2c0t1 tb2e1t1 tb2e0t1 tb2ff0c1 tb2ff0c0 read/write w * r/w w * after reset 1 1 0 0 0 0 1 1 tb2ff0 inversion trigger 0: trigger disabled 1: trigger enabled function must always be set to 11. * these bits are always 11 when read. when up-counter value is latched into tb2cp1 when up-counter value is latched into tb2cp0 when up-counter and tb2rg1 values match when up-counter and tb2rg0 values match tb2ff0 control 00: invert 01: set 10: clear 11: don?t care * these bits are always 11 when read. 00 tb2ff0 value inverted (soft inversion) 01 tb2ff0 set to 1 10 tb2ff0 set to 0 11 don?t care (read as 11) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) figure 3.10.18 tmrb registers tb2ffcr (0xffff_ f163) control of timer flip-flop (tb2ff0) trigger for inverting timer flip-flop (tb2ff0) when up-counter and tb2rg0 values match trigger for inverting timer flip-flop (tb2ff0) when up-counter and tb2rg1 values match trigger for inverting timer flip-flop (tb2ff0) when up-counter value is latched into tb2cp0 trigger for inverting timer flip-flop (tb2ff0) when up-counter value is latched into tb2cp1
tx1942cy/cz tmp1942cy/cz-214 tmrb3 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ? ? tb3c1t1 tb3c0t1 tb3e1t1 tb3e0t1 tb3ff0c1 tb3ff0c0 read/write w * r/w w * after reset 1 1 0 0 0 0 1 1 tb3ff0 inversion trigger 0: trigger disabled 1: trigger enabled function must always be set to 11. * these bits are always 11 when read. when up-counter value is latched into tb3cp1 when up-counter value is latched into tb3cp0 when up-counter and tb3rg1 values match when up-counter and tb3rg0 values match tb3ff0 control 00: invert 01: set 10: clear 11: don?t care * these bits are always 11 when read. 00 tb3ff0 value inverted (soft inversion) 01 tb3ff0 set to 1 10 tb3ff0 set to 0 11 don?t care (read as 11) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) figure 3.10.19 tmrb registers tb3ffcr (0xffff_ f173) control of timer flip-flop (tb3ff0) trigger for inverting timer flip-flop (tb3ff0) when up-counter and tb3rg0 values match trigger for inverting timer flip-flop (tb3ff0) when up-counter and tb3rg1 values match trigger for inverting timer flip-flop (tb3ff0) when up-counter value is latched into tb3cp0 trigger for inverting timer flip-flop (tb3ff0) when up-counter value is latched into tb3cp1
tx1942cy/cz tmp1942cy/cz-215 tmrb4 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ? ? tb4c1t1 tb4c0t1 tb4e1t1 tb4e0t1 tb4ff0c1 tb4ff0c0 read/write w * r/w w * after reset 1 1 0 0 0 0 1 1 tb4ff0 inversion trigger 0: trigger disabled 1: trigger enabled function must always be set to 11. * these bits are always 11 when read. when up-counter value is latched into tb4cp1 when up-counter value is latched into tb4cp0 when up-counter and tb4rg1 values match when up-counter and tb4rg0 values match tb4ff0 control 00: invert 01: set 10: clear 11: don?t care * these bits are always 11 when read. 00 tb4ff0 value inverted (soft inversion) 01 tb4ff0 set to 1 10 tb4ff0 set to 0 11 don?t care (read as 11) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) figure 3.10.20 tmrb registers tb4ffcr (0xffff_ f183) control of timer flip-flop (tb4ff0) trigger for inverting timer flip-flop (tb4ff0) when up-counter and tb4rg0 values match trigger for inverting timer flip-flop (tb4ff0) when up-counter and tb4rg1 values match trigger for inverting timer flip-flop (tb4ff0) when up-counter value is latched into tb4cp0 trigger for inverting timer flip-flop (tb4ff0) when up-counter value is latched into tb4cp1
tx1942cy/cz tmp1942cy/cz-216 tmrb5 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ? ? tb5c1t1 tb5c0t1 tb5e1t1 tb5e0t1 tb5ff0c1 tb5ff0c0 read/write w * r/w w * after reset 1 1 0 0 0 0 1 1 tb5ff0 inversion trigger 0: trigger disabled 1: trigger enabled function must always be set to 11. * these bits are always 11 when read. when up-counter value is latched into tb5cp1 when up-counter value is latched into tb5cp0 when up-counter and tb5rg1 values match when up-counter and tb5rg0 values match tb5ff0 control 00: invert 01: set 10: clear 11: don?t care * these bits are always 11 when read. 00 tb5ff0 value inverted (soft inversion) 01 tb5ff0 set to 1 10 tb5ff0 set to 0 11 don?t care (read as 11) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) figure 3.10.21 tmrb registers tb5ffcr (0xffff_ f193) control of timer flip-flop (tb5ff0) trigger for inverting timer flip-flop (tb5ff0) when up-counter and tb5rg0 values match trigger for inverting timer flip-flop (tb5ff0) when up-counter and tb5rg1 values match trigger for inverting timer flip-flop (tb5ff0) when up-counter value is latched into tb5cp0 trigger for inverting timer flip-flop (tb5ff0) when up-counter value is latched into tb5cp1
tx1942cy/cz tmp1942cy/cz-217 tmrb6 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ? ? tb6c1t1 tb6c0t1 tb6e1t1 tb6e0t1 tb6ff0c1 tb6ff0c0 read/write w * r/w w * after reset 1 1 0 0 0 0 1 1 tb6ff0 inversion trigger 0: trigger disabled 1: trigger enabled function must always be set to 11. * these bits are always 11 when read. when up-counter value is latched into tb6cp1 when up-counter value is latched into tb6cp0 when up-counter and tb6rg1 values match when up-counter and tb6rg0 values match tb6ff0 control 00: invert 01: set 10: clear 11: don?t care * these bits are always 11 when read. 00 tb6ff0 value inverted (soft inversion) 01 tb6ff0 set to 1 10 tb6ff0 set to 0 11 don?t care (read as 11) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) figure 3.10.22 tmrb registers tb6ffcr (0xffff_ f1a3) control of timer flip-flop (tb6ff0) trigger for inverting timer flip-flop (tb6ff0) when up-counter and tb6rg0 values match trigger for inverting timer flip-flop (tb6ff0) when up-counter and tb6rg1 values match trigger for inverting timer flip-flop (tb6ff0) when up-counter value is latched into tb6cp0 trigger for inverting timer flip-flop (tb6ff0) when up-counter value is latched into tb6cp1
tx1942cy/cz tmp1942cy/cz-218 tmrb7 flip-flop control register 7 6 5 4 3 2 1 0 bit symbol ? ? tb7c1t1 tb7c0t1 tb7e1t1 t b7e0t1 tb7ff0c1 tb7ff0c0 read/write w * r/w w * after reset 1 1 0 0 0 0 1 1 tb7ff0 inversion trigger 0: trigger disabled 1: trigger enabled function must always be set to 11. * these bits are always 11 when read. when up-counter value is latched into tb7cp1 when up-counter value is latched into tb7cp0 when up-counter and tb7rg1 values match when up-counter and tb7rg0 values match tb7ff0 control 00: invert 01: set 10: clear 11: don?t care * these bits are always 11 when read. 00 tb7ff0 value inverted (soft inversion) 01 tb7ff0 set to 1 10 tb7ff0 set to 0 11 don?t care (read as 11) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) 0 trigger disabled (inversion disabled) 1 trigger enabled (inversion enabled) figure 3.10.23 tmrb registers tb7ffcr (0xffff_ f1b3) control of timer flip-flop (tb7ff0) trigger for inverting timer flip-flop (tb7ff0) when up-counter and tb7rg0 values match trigger for inverting timer flip-flop (tb7ff0) when up-counter and tb7rg1 values match trigger for inverting timer flip-flop (tb7ff0) when up-counter value is latched into tb7cp0 trigger for inverting timer flip-flop (tb7ff0) when up-counter value is latched into tb7cp1
tx1942cy/cz tmrb0 status register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? inttbof0 inttb01 inttb00 read/write ? ? ? ? ? r after reset ? ? ? ? ? 0 0 0 function 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated tb0st (0xffff_ f144) inttb00: interrupt generated upon detection of match with timer register tb0rg0 inttb01: interrupt generated upon detection of match with timer register tb0rg1 inttbof0: interrupt generated upon detection of up-counter overflow tmrb1 status register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? inttbof1 inttb11 inttb10 read/write ? ? ? ? ? r after reset ? ? ? ? ? 0 0 0 function 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated tb1st (0xffff_ f154) inttb10: interrupt generated upon detection of match with timer register tb1rg0 inttb11: interrupt generated upon detection of match with timer register tb1rg1 inttbof1: interrupt generated upon detection of up-counter overflow figure 3.10.1 tmrb registers tmp1942cy/cz-219
tx1942cy/cz tmrb2 status register a. when tb2run = 0: normal timer mode 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? inttbof2 inttb21 inttb20 read/write ? ? ? ? ? r after reset ? ? ? ? ? 0 0 0 function 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated tb2st (0xffff_ f164) inttb20: interrupt generated upon detection of match with timer register tb2rg0 inttb21: interrupt generated upon detection of match with timer register tb2rg1 inttbof2: interrupt generated upon detection of up-counter overflow b. when tb2run = 1: 2-phase pulse input counter mode 7 6 5 4 3 2 1 0 bit symbol ? ? ? inttbud2 inttbudf2 inttbouf2 ? ? read/write ? ? ? r ? ? after reset ? ? ? 0 0 0 ? ? function up or down count 0: not detected 1: detected underflow 0: not detected 1: detected overflow 0: not detected 1: detected tb2st (0xffff_ f164) inttbudf2: interrupt generated upon detection of up-down counter underflow inttbovf2: interrupt generated upon detection of up-down counter overflow inttbud2: interrupt generated upon detection of up-down counter increment or decrement figure 3.10.25 tmrb registers tmp1942cy/cz-220
tx1942cy/cz tmrb3 status register a. when tb3run = 0: normal timer mode 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? inttbof3 inttb31 inttb30 read/write ? ? ? ? ? r after reset ? ? ? ? ? 0 0 0 function 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated tb3st (0xffff_ f174) inttb30: interrupt generated upon detection of match with timer register tb3rg0 inttb31: interrupt generated upon detection of match with timer register tb3rg1 inttbof3: interrupt generated upon detection of up-counter overflow b. when tb3run = 1: 2-phase pulse input counter mode 7 6 5 4 3 2 1 0 bit symbol ? ? ? inttbud3 inttbudf3 inttbouf3 ? ? read/write ? ? ? r ? ? after reset ? ? ? 0 0 0 ? ? function up or down count 0: not detected 1: detected underflow 0: not detected 1: detected overflow 0: not detected 1: detected tb3st (0xffff_ f174) inttbudf3: interrupt generated upon detection of up-down counter underflow inttbovf3: interrupt generated upon detection of up-down counter overflow inttbud3: interrupt generated upon detection of up-down counter increment or decrement tmrb4 status register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? inttbof4 inttb41 inttb40 read/write ? ? ? ? ? r after reset ? ? ? ? ? 0 0 0 function 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated tb4st (0xffff_ f184) inttb40: interrupt generated upon detection of match with timer register tb4rg0 inttb41: interrupt generated upon detection of match with timer register tb4rg1 inttbof4: interrupt generated upon detection of up-counter overflow figure 3.10.26 tmrb registers tmp1942cy/cz-221
tx1942cy/cz tmrb5 status register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? inttbof4 inttb41 inttb40 read/write ? ? ? ? ? r after reset ? ? ? ? ? 0 0 0 function 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated tb5st (0xffff_ f194) inttb50: interrupt generated upon detection of match with timer register tb5rg0 inttb51: interrupt generated upon detection of match with timer register tb5rg1 inttbof5: interrupt generated upon detection of up-counter overflow tmrb6 status register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? inttbof6 inttb61 inttb60 read/write ? ? ? ? ? r after reset ? ? ? ? ? 0 0 0 function 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated tb6st (0xffff_ f1a4) inttb60: interrupt generated upon detection of match with timer register tb6rg0 inttb61: interrupt generated upon detection of match with timer register tb6rg1 inttbof6: interrupt generated upon detection of up-counter overflow tmrb7 status register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? inttbof7 inttb71 inttb70 read/write ? ? ? ? ? r after reset ? ? ? ? ? 0 0 0 function 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated tb7st (0xffff_ f1b4) inttb70: interrupt generated upon detection of match with timer register tb7rg0 inttb71: interrupt generated upon detection of match with timer register tb7rg1 inttbof7: interrupt generated upon detection of up-counter overflow figure 3.10.27 tmrb registers tmp1942cy/cz-222
tx1942cy/cz tmrb8 status register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? inttbof8 inttb81 inttb80 read/write ? ? ? ? ? r after reset ? ? ? ? ? 0 0 0 function 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated tb8st (0xffff_ f1c4) inttb80: interrupt generated upon detection of match with timer register tb8rg0 inttb81: interrupt generated upon detection of match with timer register tb8rg1 inttbof8: interrupt generated upon detection of up-counter overflow tmrb9 status register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? inttbof9 inttb91 inttb90 read/write ? ? ? ? ? r after reset ? ? ? ? ? 0 0 0 function 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated tb9st (0xffff_ f1d4) inttb90: interrupt generated upon detection of match with timer register tb9rg0 inttb91: interrupt generated upon detection of match with timer register tb9rg1 inttbof9: interrupt generated upon detection of up-counter overflow tmrba status register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? inttbofa inttba1 inttba0 read/write ? ? ? ? ? r after reset ? ? ? ? ? 0 0 0 function 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated tbast (0xffff_ f1e4) inttba0: interrupt generated upon detection of match with timer register tbarg0 inttba1: interrupt generated upon detection of match with timer register tbarg1 inttbofa: interrupt generated upon detection of up-counter overflow figure 3.10.28 tmrb registers tmp1942cy/cz-223
tx1942cy/cz tmrbb status register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? inttbofb inttbb1 inttbb0 read/write ? ? ? ? ? r after reset ? ? ? ? ? 0 0 0 function 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated tbbst (0xffff_ f1f4) inttbb0: interrupt generated upon detection of match with timer register tbbrg0 inttbb1: interrupt generated upon detection of match with timer register tbbrg1 inttbofb: interrupt generated upon detection of up-counter overflow tmrbc status register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? inttbof9 inttb91 inttb90 read/write ? ? ? ? ? r after reset ? ? ? ? ? 0 0 0 function 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated tbcst (0xffff_ f204) inttbc0: interrupt generated upon detection of match with timer register tbcrg0 inttbc1: interrupt generated upon detection of match with timer register tbcrg1 inttbofc: interrupt generated upon detection of up-counter overflow tmrbd status register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? inttbofd inttbd1 inttbd0 read/write ? ? ? ? ? r after reset ? ? ? ? ? 0 0 0 function 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated tbdst (0xffff_ f214) inttbd0: interrupt generated upon detection of match with timer register tbdrg0 inttbd1: interrupt generated upon detection of match with timer register tbdrg1 inttbofd: interrupt generated upon detection of up-counter overflow figure 3.10.29 tmrb registers tmp1942cy/cz-224
tx1942cy/cz 3.10.4 functional description for each mode (1) 16-bit interval timer mode to generate interrupts at certain intervals, set th e interval time in the timer register tb0rg1 and enable inttb01 interrupts. 7 6 5 4 3210 tb0run 0 0 x x ? 0x0 stop tmrb0. imc7lh x x 1 1 0100 enable inttb0 and set its priority level to 4. tb0ffcr 1 1 0 0 0011 disable trigger. tb0mod 0 0 1 0 0 1 * * ( ** = 01, 10, 11) select prescaler output clock as input clock and disable capture function. tb0rg1 * * * * * * * * set interval time. * * * * * * * * (16 bits) tb0run 0 0 x x ? 1x1 start tmrb0. note: x = don?t care; ??? = no change (2) 16-bit event counter mode the timer can be used as an event counter by selecting an external clock (input to the tb0in0 pin) as its input clock. the up-counter is incremented on each rising edge of the tb0in0 pin input. the count value can be read by capturing it by software and reading the captured value. 7 6 5 4 3210 tb0run 0 0 x x ? 0x0 stop tmrb0. pacr ? ? ? - ? ? ? 0 pafc ? ? ? - ? ? ? 1 set pa0 to input mode. imc7lh x x 1 1 0100 enable inttb0 and set its priority level to 4. tb0ffcr 1 1 0 0 0011 disable trigger. tb0mod 0 0 1 0 0100 select tb0in0 pin input as input clock. tb0rg1 * * * * * * * * set count (16 bits). tb0run 0 0 x x ? 1x1 start tmrb0. note: x = don?t care; ??? = no change when the timer is used as an event counter, the prescaler must be set to run (i.e. tb0run must be set to 1). tmp1942cy/cz-225
tx1942cy/cz tmp1942cy/cz-226 (3) 16-bit ppg (programmable square wave) output mode a square wave of any frequency with any duty cycle (programmable square wave) can be output. either low-active or high-active output pulses can be selected. this mode is used to output a programmable square wave on the tb0out pin by triggering inversion of the timer flip-flop (tb0ff) when the values in the up-counter (uc0) and one of the timer registers (tb0rg0 or tb0rg1) match. however, the values set in tb0rg0 and tb0rg1 must satisfy the following condition: (tb0rg0 set value) < (tb0rg1 set value) figure 3.10.30 example ppg output waveform if tb0rg0 has its double-buffer enabled in this mode , the value in register buffer 0 is shifted into tb0rg0 when tb0rg1 and uc0 match. using the double-buffer facilitates satisfying the requirements for small duty cycle waveforms. figure 3.10.31 register buffer operation tb0rg0 and up-counter match (inttb00 interrupt) tb0rg1 and up-counter match (inttb01 interrupt) tb0out pin q 1 q 2 q 2 q 3 shift to tb0rg0 up-counter = q 1 up-counter = q 2 tb0rg0 and up-counter match tb0rg1 and up-counter match tb0rg0 (compare value) register buffer write to tb0rg0
tx1942cy/cz tmp1942cy/cz-227 figure 3.10. figure 3.10.32 16-bit ppg output mode block diagram 32 shows a block diagram of 16-bit ppg output mode. to use the timer in 16-bit ppg output m ode, set each register as shown below. 7 6 5 4 3 2 1 0 tb0run 0 0 x x ? 0x0 disable tb0rg0 double-buffer and stop tmrb0. tb0rg0 * * * * * * * * set duty cycle (16 bits). tb0rg1 * * * * * * * * set ppg cycle (16 bits). tb0run 1 0 x x ? 0x0 enable tb0rg0 double-buffer. (duty cycle and ppg cycle are changed by inttb01 interrupt.) tb0ffcr x x 0 0 1 1 1 0 set tb0ff0 so that its value will be inverted on detecting a match with tb0rg0 or tb0rg1. also initialize tb0ff0 to 0. tb0mod 0 0 1 0 0 1 * * ( ** = 01, 10, 11) select prescaler output clock as input clock and disable capture function. p7cr ? 1 ? ? ? ? ? ? p7fc ? 1 ? ? ? ? ? ? set pa2 pin to tb0out. tb0run 1 0 x x ? 1x1 start tmrb0. note1: x = don?t care; ??? = no change note2: please do not stop a timer in ppg mode at the time of duty change (please use a double buffer). in order to change a timer-related setup, please perform the following setup, when you resume after a stop (="0") (="1"). (1) change a timer output terminal to a port function. (2) timer stop (="0") (3) forbid a reversal output at the time of coincidence with a up counter and a timer register (tbnffcr=00). (4) start a timer (="1"). (5) suspend a timer (="0"). (6) a setup of the contents of change. (7) change an output terminal from a port function to a timer output. (8) start a timer (="1"). selector selector tb0run match tb0rg0 16-bit comparator register buffer 0 16-bit up-counter uc0 f/f (tb0ff0) 16-bit comparator internal bus tb0rg1 tb0rg0-wr tb0in0 t1 t4 t16 tb0out (ppb output) tb0run clear
tx1942cy/cz tmp1942cy/cz-228 (4) application examples using the capture function with its capture function enabled, tmrb can be used for various applications including those presented in the examples given below: a. one-shot pulse output using an external trigger pulse b. frequency measurement c. pulse width measurement d. time difference measurement a. one-shot pulse output using an external trigger pulse to output a one-shot pulse using an external trigger pulse, follow the procedure described below. let the 16-bit up-counter uc0 count up in free-running mode using the prescaler output clock. enter an external trigger pulse via the tb0in0 pin and use the capture function to latch the up-counter value into the capture register (tb0cp0) at the rising edge of the external trigger pulse. set intc so that an int3 interrupt is generated when the external trigger pulse goes high. during this interrupt write the sum of the tb0cp0 value (c) and the delay time (d) to the timer register tb0rg0. similarly, write the sum of the tb0rg0 value and the one-shot pulse width (p), i.e. (c + d + p), to the timer register tb0rg1. then, set the relevant field in the timer flip-flop control register (tb0ffcr ) to 11, enabling the trigger so that the timer flip-flop (tb0ff0) will be inverted on detection of a match between the value of uc0 and the value of tb0rg0 or tb0rg1. after a one-shot pulse is output, disable inversion during inttb0 interrupt handling. the terms (c), (d) and (p) in the above ex planation correspond to c, d and p in figure 3.10. figure 3.10.33 one-shot pulse output (with delay) , one-shot pulse output (with delay). tb0out timer output pin c + d + p c + d c inversion by latch into cap1 remains disabled inversion enabled (p) (d) pulse width delay time inversion enabled inttb0 g enerated latched into capture register 1 (cap1) int3 generated count clock (internal clock) counter in free-running mode tb0in0 pin input (external trigger pulse) tb0rg0 and uc0 match tb0rg1 and uc0 match inttb0 generated
tx1942cy/cz set-up example: to output a 2 ms one-shot pulse with a delay time of 3 ms after an external trigger pulse on the tb0in0 pin * clock conditions system clock: high-speed (fc) high-speed clock gear: 1 (fc) prescaler clock: fperiph/4 (fperiph = fsys) settings in the main routine place counter in free-running mode. 7 6 5 4 3210 use t1 as clock source for counting. tb0mod x x 1 0 1001 latch count into tb0cp0 on rise of tb0in0 input. tb0ffcr x x 0 0 0010 clear tb0ff0 to 0. disable inversion of tb0ff0. pacr ? - ? ? ? 1 ? ? pafc ? - ? ? ? 1 ? ? set pa2 pin to tb0out. imc0hl x x 1 1 0100 imc7lh x x 1 1 0000 enable int3 and disable inttb0 tb0run ? 0 x x ? 1x1 start tmrb0. settings in int3 tb0rg0 tb0cp0 + 3ms/ t1 tb0rg1 tb0rg0 + 2ms/ t1 tb0ffcr x x ? ? 11? ? enable tb0ff0 inversion when up-counter value matches tb0rg0 or tb0rg1. imc7lh x x 1 1 0100 enable inttb0. settings in inttb0 tb0ffcr x x ? ? 00? ? disable tb0ff0 inversion when up-counter value matches tb0rg0 or tb0rg1. imc7lh x x 1 1 0000 disable inttb0. note: x = don?t care; ??? = no change if a delay is not necessary, invert tb0ff0 by latching the counter value into tb0cp0; then, during the int3 interrupt, write the sum of the tb0cp0 value (c) and the one-shot pulse width (p) to tb0rg1. enable the trigger so that tb0ff0 will be inverted on detection of a match between the value of uc0 and the value of tb0rg1. tb0ff0 inversion should be disabled during inttb0 interrupt handling. tmp1942cy/cz-229
tx1942cy/cz c + p c inversion enabled (p) pulse width latched into capture register tb0cp0 count clock (prescaler output clock) tb0in0 pin input (external trigger pulse) tb0rg1 and uc0 match tb0out timer output pin latched into capture register tb0cp1 inttb01 generated inversion by latch into tb0cp0 remains enabled tb0ff0 left disabled so that it will not be inverted by latch into tb0cp1 int5 generated figure 3.10.34 one-shot pulse output using an external trigger pulse (without delay) b. frequency measurement with its capture function enabled, the timer can be used to measure the frequency of an external clock. the frequency is measured using a combinati on of a 16-bit timer/event counter and 8-bit timers (tmra01). (tmra01 determines the measurement time by inverting ta1ff.) select tb0in0 pin input as the count clock for tmrb0 so that it counts up synchronously with the external clock pulses. set tb0mod to 11. this setting causes the count value of the 16-bit up-counter uc0 to be latched into the capture register tb0cp0 when the 8-bit timer (tmra01) flip-flop (ta1ff) output goes high, and to be latched into the capture register tb0cp1 when the ta1ff output goes low. the frequency is calculated from the difference between the loaded values in tb0cp0 and tb0cp1 based on the measurement time determined by an 8-bit timer interrupt intta0 or intta1. c2 c1 c2 c1 c2 c1 count clock (tb0in0 pin input) ta1out latched into tb0cp0 latched into tb0cp1 intta0/intta1 figure 3.10.35 frequency measurement for example, if the 8-bit timers set the high level width of ta1ff to 0.5 s and the difference between tb0cp0 and tb0cp1 is 100, then the frequency is 100/0.5 s = 200 hz. tmp1942cy/cz-230
tx1942cy/cz c. pulse width measurement with its capture function enabled, the timer can be used to measure the high-level duration of an external pulse. enter an ex ternal pulse via the tb0in0 pin and let the up-counter (uc0) count up in free-running mode using the prescaler output clock. then, using the capture function, latch the up-counter value into the capture registers tb0cp0 and tb0cp1 on the rising and falling edges of the external pulse, re spectively. set intc so that int5 is generated when the tb0in0 pin goes low. the high-level duration of the pulse can be obtained by finding the difference between tb0cp0 and tb0cp1 and multiplying the resulting value by the internal clock period. for example, if the difference between tb0cp0 and tb0cp1 is 100 and the prescaler output clock period is 0.5 s, then the pulse width will be 100 0.5 s = 50 s. additionally, the pulse width which exceeds the uc0 maximum count time specified by the clock source can be measured by software coding. c2 c1 c2 c1 c2 c1 prescaler output clock tb0in0 pin input (external pulse) latched into tb0cp0 int5 latched into tb0cp1 figure 3.10.36 pulse width measurement figure 3.10. the low-level duration can be measured usin g the time difference measurement function shown in . the low-level duration is obtained by multiplying the difference between the first c2 and the second c1 by the prescaler output clock period during the handling of the second int5 interrupt. tmp1942cy/cz-231
tx1942cy/cz d. time difference measurement with its capture function enabled, the timer can be used to measure the difference in time between two events. let the up-counter (uc0) count up in free-running mode using the prescaler output clock. latch the uc0 value into the capture register tb0cp0 at the rising edge of the pulse input on the tb0in0 pin. set intc so that an int3 interrupt is generated at that point. latch the uc0 value into the capture register (t b0cp1) at the rising e dge of the pulse input on the tb0in1 pin. set intc so that an in t4 interrupt is generated at that point. the difference in time can be obtained by subtracting the value in tb0cp0 from the value in tb0cp1 after the values have been latched into the capture registers, and then multiplying the difference by the internal clock period. time difference c2 c1 tb0in0 pin input tb0in1 pin input int3 latched into tb0cp0 int4 latched into tb0cp1 prescaler output clock figure 3.10.37 time difference measurement tmp1942cy/cz-232
tx1942cy/cz tmp1942cy/cz-233 (5) 2-phase pulse input counter mode (tmrb2 and tmrb3) (the function operates in the same way for tmrb2 and tmrb3. only tmrb2 is described here.) in this mode, the counter is e ither incremented or decremente d by one according to the state transition of 2-phase clock pulses, with a phase difference of 90 degrees, input from tb2in0 and tb2in1. an interrupt is generated when the up/down-counter overflows or underflows, or when it is incremented or decremented. a. count operation ? counting up figure 3.10.38 counting up ? counting down figure 3.10.39 counting down ? sampling clock tmrb2 run register (tb2run) 7 6 5 4 3 2 1 0 bit symbol tb2rde ? ud2ck tb2udce i2tb2 tb2prun ? tb2run read/write r/w ? r/w r/w r/w r/w ? r/w after reset 0 ? 0 0 0 0 ? 0 function double buffer 0: disable 1: enable sampling clock selection 0: fs 1: fsys/2 2-phase counter enable 0: disable 1: enable idle 0: idle 1: operate timer run/stop control 0: stop and cleared 1: count figure 3.10.40 register for setting 2-phase pulse input counter mode 1 1 counter value + 1 tb0in0 tb0in1 01 n n + 1 counter value counter value ? 1 tb0in0 tb0in1 0 1 n n ? 1 counter value 1 0
tx1942cy/cz tmp1942cy/cz-234 bit 5 of the tb2run register (ud2ck) determines the sampling clock to be used. ud2ck (sampling clock selection) = 0: selects fs (32 khz) (8 khz sampling) 1: selects fsys/2 (fsys/8 hz sampling) 1) exiting from stop mode because an 2-phase timer interrupt cannot be used to terminate stop mode, an interrupt on the intb or intc shared pin is used to terminate stop mode. the 2-phase counter enters stop mode while reta ining its previous state. therefore, if the relationship between the state of the input used to terminate stop mode and the retained state satisfies the condition for counting up or dow n, the counter value is incremented or decremented after stop mode has been terminated. (the counter value remains unchanged if the condition is not satisfied.) if it is necessary to obtain a constant counter state after exiting from stop mode, initialize the 2-phase counter after stop mode is terminated (clearing tb2run to 0 and then setting it to 1 initializes the counter to 0x7fff). 2) exiting from sleep mode because an 2-phase timer interrupt cannot be used to terminate sleep mode, an interrupt on the intbcde shared pin is used to terminate sleep mode. whether the 2-phase counter is incremented or decremented depe nds on the state of the input used to terminate sleep mode. if it is necessary to obtain a constant counter state after exiting from sleep mode, initialize the 2-phase counter after sleep mode is termin ated (clearing tb2run to 0 and then setting it to 1 initializes the counter to 0x7fff). b. operating mode use appropriate register bits to determine whether the external input signals on the tb2in0 and tb2in1 input pins will be sent to the ordinary 16-bit timer or to the up/down-counter. ? in up/down-counter mode, only software capture is available; capture based on external clock timing is not enabled. ? in up/down-counter mode, the comparator is disabled; comparison with timer registers is not performed. tmrb intbcde cg intc inttb2 terminate stop/sleep mode using this path.
tx1942cy/cz ? in up/down-counter mode, ordinary intb to inte interrupts (interrupts other than those used to terminate stop/sleep mode) cannot be used. ? the input clock signals are sampled at fs (32 khz) or based on the high-speed clock (system clock). when fs is used, the maximum input frequency is 8 khz. when the high-speed clock is used, the maximum input frequency is fsys/8 hz. setting the up/down-counter set tb2mod to ?00? (prescaler disabled). next, set bit 4 of the tb2run register (tb2udce) to determine whether the counter should operate as a up/down counter or as an ordinary up-counter based on external clock input. tb2udce (up/down-counter enable) = 0: normal 16-bit timer operation 1: up/down-counter operation tmrb2 run register (tb2run) 7 6 5 4 3 2 1 0 bit symbol tb2rde ? ud2ck tb2udce i2tb2 tb2prun ? tb2run read/write r/w ? r/w r/w r/w r/w ? r/w after reset 0 ? 0 0 0 0 ? 0 function double buffer 0: disable 1: enable sampling clock selection 0: fs 1: fsys/2 2-phase counter enable 0: disable 1: enable idle 0: idle 1: operate timer run/stop control 0: stop and cleared 1: count figure 3.10.41 register fo r setting the up/down-counter c. interrupts ? in normal or slow mode enable inttb2 interrupts in the interrupt c ontroller (intc). an inttb2 interrupt will occur when the counter either counts up or do wn. you can determine whether an overflow or underflow has occurred at the same time by reading the status register tb2st during the handling of the interrupt. an overflow has occurred if tb2st = 1. an underflow has occurred if tb2st = 1. this register is cleared when read. an overflow causes the counter to be initialized to 0 x0000 and an underflow causes the counter to be initialized to 0xffff, allowing the counter to continue counting. 7 6 5 4 3 2 1 0 bit symbol ? ? ? inttbud2 inttbudf2 inttbouf2 ? ? read/write ? ? ? r ? ? after reset ? ? ? 0 0 0 ? ? function up or down count 0: not detected 1: detected underflow 0: not detected 1: detected overflow 0: not detected 1: detected tb2st (0xffff_ f164) figure 3.10.42 tmrb2 status register tmp1942cy/cz-235
tx1942cy/cz tmp1942cy/cz-236 ? in sleep mode the 2-phase pulse input counter operates. enable the intbcde release input in the clock generator (cg). use intnst of the intbcde circ uit to set the active le vel for each interrupt input. an up or down counter input generates an intb or intc interrupt, causing the counter to exit from sleep mode. the interrupt source is determined by reading the flag register intflg. the flag is cleared when read. whethe r this releasing interrupt source causes the counter to count up or down depends on whether the state of the releasing input satisfies the condition for counting up or down. 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? intes intds intcs intbs read/write ? ? ? ? r after reset ? ? ? ? 0 0 0 0 function 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated 0: no interrupt generated 1: interrupt generated figure 3.10.43 intflg register ? in stop mode the 2-phase pulse input counter stops. enable the intbcde release input in the clock generator (cg). an up or down counter input generates an intb or intc interrupt, causing the counter to exit from stop mode. whether this releasing input causes the counter to count up or down depends on the relationship between the input state prior to entering stop mode and the state of the releasing input. after the releasing input is asserted, the devi ce warms up for the specified period before entering normal or slow mode to restart counting. d. up/down-counter when 2-phase input counter mode is selected (tb2run = 1), the up-counter is initialized to 0x7fff and operates as an up/down-counter. if the counter overflows, it is initialized to 0x0000 and continues counting. if the counter underflows, it is initialized to 0xffff and continues counting. therefore, you can determine the state of the counter by reading the counter value and the status flag tb2st after an interrupt occurs. note 1: ensure that the count up (down) input is high before and after it is input. note 2: the counter value must be read during exception handling for inttb2. if the counter value is read during exception handling for intb or intc used to terminate sleep or stop mode, the counter value varies depending on whether the condition is satisfied or not and the difference in time between sleep/stop mode being terminated and counting being restarted. intflg (0xffff_ f384) count up input up/down-counter value up/down interrupt sampling clock 0x3fff 0x4000 0x4001
tmp1942cy/cz tmp1942cy/cz-237 3.11 serial channels (sio) the tmp1942 contains five serial input/output channels: sio0, sio1, sio3, sio4 and sio5. each channel can be operated in (asynchronous) uart mode or (synchronous) i/o interface mode, as shown below. ? i/o interface mode mode 0: transmit and receive i/o data using the sync signal (sclk) for extended i/o operation. mode 1: transmit and receive 7-bit data. ? asynchronous (uart) m ode mode 2: transmit and receive 8-bit data. mode 3: transmit and receive 9-bit data. in modes 1 and 2 a parity bit can be added. mode 3 supports a wake-up function which is used by the master controller in a multi-controller system to initiate communi cation with a slave controller via a serial link. figure 3.11.2 shows a block diagram for sio0. each channel consists of a prescaler, a serial clock generator, a receive buffer and its accompanying control circuit, and a transmit buffer and its accompanying contro l circuit. all channels op erate independently of each other. because all channels operate in the same way, this section consists only of an explanation for sio0. ? mode 0 (i/o interface mode): lsb first ? mode 0 (i/o interface mode): msb first ? mode 1 (7-bit uart mode) ? mode 2 (8-bit uart mode) ? mode 3 (9-bit uart mode) figure 3.11.1 data formats bit 0 1 2 3 4 5 6 start 8 7 stop bit 0 1 2 3 4 5 6 start stop (wake-up) bit 8 7 a ddress (selection code) when bit 8 = 1 data when bit 8 = 0 direction of transfer 7 bit 0 1 2 3 4 5 6 direction of transfer 0 bit 7 6 5 4 3 2 1 bit 0 1 2 3 4 5 6 start stop without parity bit 0 1 2 3 4 5 6 start stop parity with parity bit 0 1 2 3 4 5 6 start stop 7 without parity bit 0 1 2 3 4 5 6 start stop parity 7 with parity
tmp1942cy/cz tmp1942cy/cz-238 3.11.1 block diagram (for channel 0 as an example) figure 3.11.2 sio0 block diagram interrupt request intrx0 sc0mod0 uart mode prescaler ta6trg (from tmra0) 16 32 64 8 4 2 t2 t8 t32 t0 br0cr br0add selector selector selector divider t0 t2 t8 t32 br0cr f sys /2 i/o interface mode 2 selector i/o interface mode sc0cr sc0mod0 < wu > receive counter (divided by 16 for uart only) transmit counter (divided by 16 for uart only) transmission controller receive controller receive buffer 1 (shift register) rb8 receive buffer 2 (sc0buf) error flag sc0mod0 transmit buffer 2 (sc0buf) internal data bus sc0cr txd0 (shared with pd0) 0cts (shared with pd2) internal data bus interrupt request inttx0 sc0mod0 rxd0 (shared with pd1) sc0cr txdclk sc0mod0 parity controller internal data bus serial clock generator sclk0 input (shared with pd2) sclk0 output (shared with pd2) baud rate generator rxdclk transmit buffer 1 (shift register) sioclk br0cr serial channel interrupt control tb8
tmp1942cy/cz tmp1942cy/cz-239 3.11.2 functional description of each circuit (for channel 0 as an example) (1) prescaler the tmp1942 has a 6-bit prescaler to supply an operating clock to sio0. the prescaler?s input clock t0 has a frequency of fperiph, fperiph/2 or fperiph/4 as selected by syscr0 in the cg block. fperiph is either the clock fgear as selected by syscr1 in the cg block or the clock fc before division by the clock gear. the prescaler operates only when the baud rate gene rator has been specified as the serial transfer clock. table 3.11.1 shows the resolutions of the prescaler output clocks. t able 3.1 1.1 baud rate generator input clock resolutions @ = 32 mhz prescaler output clock resolution peripheral clock selection clock gear value selected prescaler clock t0 t2 t8 t32 00 (fperiph/4) fc/2 2 (0.125 s) fc/2 4 (0.5 s) fc/2 6 (2.0 s) fc/2 8 (8.0 s) 01 (fperiph/2) ? fc/2 3 (0.25 s) fc/2 5 (1.0 s) fc/2 7 (4.0 s) 00 (fc) 10 (fperiph) ? fc/2 2 (0.125 s) fc/2 4 (0.5 s) fc/2 6 (2.0 s) 00 (fperiph/4) fc/2 3 (0.25 s) fc/2 5 (1.0 s) fc/2 7 (4.0 s) fc/2 9 (16 s) 01 (fperiph/2) ? fc/2 4 (0.5 s) fc/2 6 (2.0 s) fc/2 8 (8.0 s) 01 (fc/2) 10 (fperiph) ? fc/2 3 (0.25 s) fc/2 5 (1.0 s) fc/2 7 (4.0 s) 00 (fperiph/4) fc/2 4 (0.5 s) fc/2 6 (2.0 s) fc/2 8 (8.0 s) fc/2 10 (32 s) 01 (fperiph/2) ? fc/2 5 (1.0 s) fc/2 7 (4.0 s) fc/2 9 (16 s) 10 (fc/4) 10 (fperiph) ? fc/2 4 (0.5 s) fc/2 6 (2.0 s) fc/2 8 (8.0 s) 00 (fperiph/4) fc/2 5 (1.0 s) fc/2 7 (4.0 s) fc/2 9 (16 s) fc/2 11 (64 s) 01 (fperiph/2) ? fc/2 6 (2.0 s) fc/2 8 (8.0 s) fc/2 10 (32 s) 0 (fgear) 11 (fc/8) 10 (fperiph) ? fc/2 5 (1.0 s) fc/2 7 (4.0 s) fc/2 9 (16 s) 00 (fperiph/4) fc/2 2 (0.125 s) fc/2 4 (0.5 s) fc/2 6 (2.0 s) fc/2 8 (8.0 s) 01 (fperiph/2) ? fc/2 3 (0.25 s) fc/2 5 (1.0 s) fc/2 7 (4.0 s) 00 (fc) 10 (fperiph) ? fc/2 2 (0.125 s) fc/2 4 (0.5 s) fc/2 6 (2.0 s) 00 (fperiph/4) ? fc/2 4 (0.5 s) fc/2 6 (2.0 s) fc/2 8 (8.0 s) 01 (fperiph/2) ? fc/2 3 (0.25 s) fc/2 5 (1.0 s) fc/2 7 (4.0 s) 01 (fc/2) 10 (fperiph) ? ? fc/2 4 (0.5 s) fc/2 6 (2.0 s) 00 (fperiph/4) ? fc/2 4 (0.5 s) fc/2 6 (2.0 s) fc/2 8 (8.0 s) 01 (fperiph/2) ? ? fc/2 5 (1.0 s) fc/2 7 (4.0 s) 10 (fc/4) 10 (fperiph) ? ? fc/2 4 (0.5 s) fc/2 6 (2.0 s) 00 (fperiph/4) ? ? fc/2 6 (2.0 s) fc/2 8 (8.0 s) 01 (fperiph/2) ? ? fc/2 5 (1.0 s) fc/2 7 (4.0 s) 1 (fc) 11 (fc/8) 10 (fperiph) ? ? ? fc/2 6 (2.0 s) note 1: the prescaler?s output clock tn must be selected such that the relationship tn < fsys/2 is satisfied (i.e., tn must be slower than fsys/2). note 2: do not change the clock gear value while the timer is running note 3: the ? character means ?don?t use? one of prescaler output clocks - t0, t2, t8 or t32 - is used for the serial interface baud rate generator.
tmp1942cy/cz tmp1942cy/cz-240 (2) baud rate the baud rate generator is used to generate the transmit/receive clock which determines the rate at which data is transferred via serial channels. the clock source fed to the baud rate generator is the clock t0, t2, t8 or t32 as output by the 6-bit prescaler. this input clock is selected by setting the bits br0cr in the baud rate generator control register. the baud rate generator contains a divider which can divide the input clock frequency by 1, n + 16 m (n = 2-15, m = 0-15) or 16. the input clock frequ ency is divided according to the values set in br0cr and br0add
to specify the rate of transfer. ? for uart mode 1) when br0cr = 0 the value set in br0add is ignored and the input clock is divided by the value n set in br0cr (n = 1, 2, 3... 16). 2) when br0cr = 1 the input clock is divided by n+(16-k)/16, where the value of n is specified by br0cr (n = 2, 3... 15) and the value of k is specified by br0add (k = 1, 2, 3... 15). note: when n = 1 or 16, division by n+(16-k) /16 is disabled. in that case, always set br0cr to 0. ? for i/o interface mode division by n+(16-k)/16 cannot be used in i/o interface mode. in this mode always set br0cr to 0 so that the input clock will be divided by n. the baud rate is calculated as follows: ? in uart mode baud rate = divisor generator rate baud clockinput generator rate baud 16 the maximum baud rate which can be generated by the baud rate generator is 500 kbps and is generated when t0 = 8 mhz. in addition to an output from the baud rate generator, fsys/2 can also be used as a serial clock. if fsys/2 is used as a serial clock, the maximu m baud rate is 1 mbps, which is generated when fsys = 32 mhz. ? in i/o interface mode baud rate = divisor generator rate baud clockinput generator rate baud 2
tmp1942cy/cz tmp1942cy/cz-241 ? when dividing the input clock by an integer (n) if t2 is chosen as the input clock to the baud rate generator with the divisor n (br0cr) set to 10 and br0cr set to 0 after fc = 24.576 mhz has been specified as fperiph and t0 has been set to fperiph/4, then the baud rate in uart mode is calculated as follows: * clock conditions system clock : high-speed (fc) high-speed clock gear : 1 (fc) prescaler clock : fperiph/4 (fperiph = fsys) baud rate = 10 16/fc 16 = 24.576 10 6 16 10 16 = 9600 (bps) note: since division by n+(16-k)/16 is disabl ed, the value set in br0add is ignored. ? when dividing the input clock by n+(16-k)/16 (uart mode only) if t2 is chosen as the input clock to the baud rate generator with the divisor n (br0cr) set to 7, k (br0add) set to 3 and br0cr set to 1 after fc = 19.2 mhz has been specified as fperiph and t0 has been set to fperiph/4, the baud rate is calculated as follows: * clock conditions system clock : high-speed (fc) high-speed clock gear : 1 (fc) prescaler clock : fperiph/4 (fperiph = fsys) baud rate = 16 3 - 16 + 7 16/fc 16 = 19.2 10 6 16 (7 + 16 13 ) 16 = 9600 (bps) tables 3.11.2 and 3.11.3 show example baud rates in uart mode. instead of a prescaler output, a clock input from an external source can also be used as the serial clock. in this case the baud rate is calculated as follows: ? uart mode baud rate = external clock input/16 however, the period of the external clock must be greater than or equal to 4/fsys. ? i/o interface mode baud rate = external clock input however, the period of the external clock must be greater than or equal to 16/fsys.
tmp1942cy/cz tmp1942cy/cz-242 table 3.11.2 uart baud rate selection (when the baud rate generator is used and br0cr = 0) units: kbps input clock fc [mhz] divisor n (specified with br0cr) t0 (fc/4) t2 (fc/16) t8 (fc/64) t32 (fc/256) 19.6608 1 307.200 76.800 19.200 4.800 2 153.600 38.400 9.600 2.400 4 76.800 19.200 4.800 1.200 8 38.400 9.600 2.400 0.600 0 19.200 4.800 1.200 0.300 24.576 5 76.800 19.200 4.800 1.200 a 38.400 9.600 2.400 0.600 29.4912 1 460.800 115.200 28.800 7.200 2 230.400 57.600 14.400 3.600 3 153.600 38.400 9.600 2.400 4 115.200 28.800 7.200 1.800 6 76.800 19.200 4.800 1.200 c 38.400 9.600 2.400 0.600 note: the values shown in the table above are applied when the system clock frequency = fc, the clock gear = fc/1 and the prescaler clock frequency = fperiph/4. table 3.11.3 uart baud rate selection (when tmra6 timer trigger output is used and tmra6 input clock = t1) units: kbps fc ta0reg 29.4912 mhz 24.576 mhz 24 mhz 19.6608 mhz 16 mhz 12.288 mhz 1h 230.4 192 187.5 153.6 125 96 2h 115.2 96 93.75 76.8 62.5 48 3h 76.8 64 62.5 51.2 41.67 32 4h 57.6 48 46.88 38.4 31.25 24 5h 46.08 38.4 37.5 30.72 25 19.2 6h 38.4 32 31.25 25.6 20.83 16 8h 28.8 24 23.44 19.2 15.63 12 ah 23.04 19.2 18.75 15.36 12.5 9.6 10h 14.4 12 11.72 9.6 7.81 6 14h 11.52 9.6 9.38 7.68 6.25 4.8 calculate the baud rate as follows (when timer tmra6 is used): transfer rate = 162ta0reg >prck0:prck1 tmp1942cy/cz tmp1942cy/cz-243 (3) serial clock generator this circuit generates a basic clock used to transmit and receive data. ? for i/o interface mode in sclk output mode (when sc0cr = 0), the basic clock is generated by dividing the baud rate generator output, described above, by 2. in sclk input mode (when sc0cr = 1), the basic clock is generated by detecting either the rising or falling edges of the sclk input, as specified by the sc0cr setting. ? for asynchronous (uart) mode one of the following four sources is selected to generate the basic clock sioclk: the clock output by the baud rate generator as described above, the system clock (fsys/2), the trigger output signal from timer tmra6, or the exte rnal clock (on the sclk0 pin). the setting of sc0mod0 specifies which source is selected. (4) receive counter the receive counter is a 4-bit binary counter whic h is used in asynchronous (uart) mode. this counter is incremented every time a sioclk pulse is detected. receivi ng one bit of data requires 16 sioclk pulses and data is sampled three times: at the seventh, eighth and ninth pulses. the received data is determined from the three samples by majority rule. (5) receive controller ? for i/o interface mode in sclk output mode (when sc0cr = 0), the rxd0 pin is sampled at the rising edge of the shift clock which is output to the sclk0 pin. in sclk input mode (when sc0cr = 1), th e rxd0 pin is sampled at either the rising or falling edge of the sclk input, as specified by the setting of sc0cr. ? for asynchronous (uart) mode the receive controller incorporates a start bit detection circuit so that it can start receive operation upon the detection of a valid start bit.
tmp1942cy/cz tmp1942cy/cz-244 (6) receive buffer the receive buffer has double-buffer structure to prevent overrun errors. received data is stored one bit at a time in receive buffer 1 (a shift register ). when all bits of data have been received, the data is transferred to another receive buffer, r eceive buffer 2 (sc0buf), at which point an intrx0 interrupt is generated. also, the receive bu ffer full flag (sc0mod2) is set to 1 simultaneously, indicating that receive buffer 2 contains valid data. the cpu reads data from receive buffer 2 (sc0bu f). this read causes the rbfll flag to be cleared to 0. next received data can be stored in receive buffer 1 even before the cpu reads the data out from receive buffer 2 (sc0buf). when sclk output is selected in i/o interface mode, receive buffer 2 (scobuf) can be enabled or disabled by setting sc0mod 2 accordingly. disabling receive buffer 2 allows the device to handshake with the remote device it is communicating with, so that it stops clk output every time it has sent a single frame. in that case, the cpu reads data from receive buffer 1. this read causes clk output to restart. when receive buffer 2 is enabled in i/o interface mode, operation is as follows: the first received data is transferred from receive buffer 1 to receive buffer 2. clk output stops when the next data has been received and bot h receive buffers 1 and 2 contain valid data. once the cpu has read data from receive buffer 2, the data in receive buffer 1 is transferred to receive buffer 2, at which point an intrx0 interrupt is ge nerated and clk output is restarted. therefore, no overrun error occurs in sclk output i/o interface mode, regardless of the wbug setting. note: in this mode the sc0cr oeer flag has no meaning, resulting in undefined operation. be sure to read sc0cr to initialize this flag before changing the mode from sclk output mode. in other operating modes, receive buffer 2 is always enabled to improve performance for continuous transfer. however, if the cpu has not re ad the data out from r eceive buffer 2 (sc0buf) by the time all the bits of the next data item have b een received into receive bu ffer 1, an overrun error will occur. if an overrun error occurs, the contents of receive buffer 1 will be lost; the contents of receive buffer 2 and sc0 cr will be retained. sc0cr stores either the parity bit which is added to 8-bit uart data or the most significant bit of 9-bit uart data. in 9-bit uart mode, slave controller wake-up operation can be enabled by setting sc0mod0 to 1. in this case, an intrx0 interrupt is only generated if sc0cr = 1. (7) transmit counter the transmit counter is a 4-bit binary counter used in asynchronous (uart) mode. like the receive counter, this counter is incremented every time a sioclk pu lse is detected and generates a transmit clock (txdclk) pulse every 16 sioclk pulses. figure 3.11.3 generating a transmit clock sioclk txdclk 15 16 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 3 1 2
tmp1942cy/cz tmp1942cy/cz-245 (8) transmit controller ? in i/o interface mode in sclk output mode (when sc0cr = 0), data is output from the transmit buffer to the txd0 pin one bit at a time at each rising edge of the shift clock out put on the sclk0 pin. in sclk input mode (when sc0cr = 1), data is output from the transmit buffer to the txd0 pin one bit at a time, e ither at each rising edge or each falling edge of the sclk input as specified by the setting of sc0cr. ? in asynchronous (uart) mode after transmit data has been written to the transmit buffer by the cpu, the transmit controller will start transmitting the data at the next rising edge of txdclk, thus generating a transmit shift clock (txdsft). handshaking function the device has a cts pin, which makes it possible to transmit data in frame units, preventing overrun errors from occurring. this function can be enabled or disabled using sc0mod. when the 0cts pin goes high, the transmitter stops transmission after it has finished sending the current data and remains idle until the 0cts pin goes back to low. the transmit controller generates an inttx0 interrupt to request the next transmission of data fr om the cpu and, after writing the data to the transmit buffer, will wait for the new data to be sent. although the device does not have an rts pin, the handshaking function can be implemented in the following way: one of the receiver?s ports can be assigned to the function and when the receiver has finished receiving data, it drives that port high (using the receive inte rrupt routine), thereby requesting the transmitter to temporarily suspend transmission. figure 3.11.4 handshaking function note 1: when cts goes high during transmission, the transmitter will stop sending data upon the completion of transmitting the current data item. note 2: the transmitter starts sending data at th e first falling edge of the txdclk clock after the cts signal has been pulled low. figure 3.11.5 clear to send ( cts ) signal timing rxd rts (any port) receiver transmitter txd cts tmp1942 tmp1942 cts note 1 13 14 15 16 1 2 3 14 15 16 1 2 3 sioclk txdclk txd bit 0 start bit no transmission takes place during this period. timing at which data is written to the transmit buffer or shift register note 2
tmp1942cy/cz tmp1942cy/cz-246 (9) transmit buffer the transmit buffer (sc0buf) has double-buffer structure. the double-buffer can be enabled or disabled by setting sc0mod1 accordingly. when the double-buffer is enabled, data written to transmit buffer 2 (sc0buf) is transferred to transmit buffer 1 (a shift register), at which point an inttx interrupt is generated. also, the scnmod2 tbemp flag is set to 1 simultaneously, indicating that transmit buffer 2 is empty so that next transmit data can be written. the tbemp flag is cleared to 0 when next transmit data is written to transmit buffer 2. when the double-buffer is disabled, the cpu writes transmit data to transmit buffer 1 and an inttx interrupt occurs upon the completion of transmission. note: in this mode the sc0cr ueer flag has no meaning, resulting in undefined operation. be sure to read sc0cr to initialize this flag before changing the mode from sclk output mode. if it is necessary to handshake with the remote device, set wbuf to 0 to disable transmit buffer 2. to perform continuous transmission without handsh aking, you can improve performance by setting wbuf to 1 to enable transmit buffer 2. (10) parity controller data transmission with parity is enabled by setting the pe bit of the serial channel control register sc0cr to 1. note, however, that parity can only be used in 7-bit uart mode or 8-bit uart mode. the sc0cr bit can be used to select even or odd parity. during transmission the parity controller automatic ally generates parity bits from the data written to the transmit buffer (sc0buf). upon the completion of transmitting the data, it stores the parity in sc0buf in 7-bit uart mode or sc0mod0 in 8-bit uart mode. the pe and even bits in the sc0cr register must be set before the transmit data is written to the transmit buffer. during reception the parity controller automatically generates parity bits from the data which has been shifted in and transferred from receive buffer 1 to receive buffer 2 (sc0buf), and compares it with the parity stored in sc0buf in 7-bit uart mode or sc0cr in 8-bit uart mode. if the parities do not match, a parity error is generated, setting the sc0cr flag. in i/o interface mode, sc0cr is not a parity flag but functions as an underrun error flag.
tmp1942cy/cz tmp1942cy/cz-247 (11) error flags three error flags are available for the purpose of increasing the reliability of the received data. 1. overrun error in both uart and i/o interface modes, an overr un error occurs when all bits of the next frame have been received before data stored in the receive buffer is read out completely. an overrun error causes the oerr flag to be set. reading the flag clears it to 0. if sclk output is selected in i/o interface mode, however, this flag is undefined because no overrun error will occur. 2. parity error/underrun error in uart mode, the perr flag is set to 1 when a parity error occurs. a parity error occurs if the parity calculated from the received data diff ers from the received parity bit. reading the perr flag clears it to 0. in i/o interface mode, the perr bit indicates an underrun error. when sc0mod2 is set to 1, an underrun error occurs in the following case: in sclk input mode, it occurs if data stored in the transmit shift register has been tr ansmitted but no data is set in the transmit double-buffer before the next transfer clock is input. in sclk output mode, this flag is undefined because no underrun error will occur. the perr flag is not set when transmit buffer 2 is disabled. reading the flag clears it to 0. 3. framing error in uart mode, the ferr flag is set to 1 when a framing error occurs. reading the flag clears it to 0. a framing error occurs if the stop bit in the received data is detected as being 0 when sampled around the center. operating mode error flag description oerr overrun error flag perr parity error flag uart ferr framing error flag oerr overrun error flag perr underrun error flag (wbuf = 1) fixed to 0 (wbuf = 0) i/o interface (sclk input) ferr fixed to 0 oerr undefined perr undefined i/o interface (sclk output) ferr fixed to 0 note:ferr reading occurs during the interruption handling must be executed before a receive buffer reading. polling for reading ferr is prohibited. see the example in 3.11.4 (3) mode 2 (8-bit uart mode) for the details. (12) direction of data transfer in i/o interface mode, the direction of transfer can be toggled between msb first and lsb first by setting scnmod2. do not change the direction of transfer while data is being transferred.
tmp1942cy/cz tmp1942cy/cz-248 (13) stop bit length in uart mode, the stop bit length in transmit data can be toggled between one bit and two bits by setting scnmod2. (14) status flag the scnmod2 bit is a flag which indicates that the receive buffer is full when the double-buffer is enabled (wbuf = 1). once a single frame of data has been received and the data has been transferred from receive buffer 1 to receive buffer 2, this flag is set to 1, indicating that buffer 2 is full (contains data). when the cpu/dmac reads th e receive buffer, the flag is cleared to 0. when wbuf = 0, the rbfll bit has no meaning and cannot be used as a status flag. tbemp is a flag which indicates that transmit buffer 2 is empty when the double-buffer is enabled (wbuf = 1). once data has been transferred from tran smit buffer 2 to transmit buffer 1 (a shift register), this flag is set to 1, indicating that transmit buffer 2 is empty. when the cpu/dmac writes data to the transmit buffer, the flag is cleared to 0. when wbuf = 0, the tbemp bit has no meaning and cannot be used as a status flag. (15) transmit/receiver buffer configuration wbuf = 0 wbuf = 1 transmit single double uart receive double double transmit single double i/o interface (sclk input) receive double double transmit single double i/o interface (sclk output) receive single double (16) signal generation timing 1) uart mode reception mode 9 bits 8 bits + parity 8 bits, 7 bits + parity, or 7 bits interrupt generation timing center of first stop bit center of first st op bit center of first stop bit framing error generation timing center of stop bit center of stop bit center of stop bit parity error generation timing ? center of last bit (parity bit) center of last bit (parity bit) overrun error generation timing center of stop bit center of stop bit center of stop bit transmission mode 9 bits 8 bits + parity 8 bits, 7 bits + parity, or 7 bits interrupt generation timing (wbuf = 0) immediately before stop bit is sent immediately before stop bit is sent immediately before stop bit is sent interrupt generation timing (wbuf = 1) immediately after data is transferred to transmit buffer 1 (immediately before start bit is sent) immediately after data is transferred to transmit buffer 1 (immediately before start bit is sent) immediately after data is transferred to transmit buffer 1 (immediately before start bit is sent)
tmp1942cy/cz tmp1942cy/cz-249 2) i/o interface mode reception sclk output mode immediately after rise of last sclk pulse interrupt generation timing (wbuf = 0) sclk input mode immediately after rise of last sclk pulse (rise mode); in fall mode, immediately after fall of last sclk pulse sclk output mode immediately after rise of last sclk pulse (immediately after data is transferred to receive buffer 2) or immediately after data is read from receive buffer 2 interrupt generation timing (wbuf = 1) sclk input mode immediately after rise of last sclk pulse (rise mode); in fall mode, immediately after fall of last sclk pulse (immediately after data is transferred to receive buffer 2) sclk output mode immediately after rise of last sclk pulse overrun error generation timing sclk input mode immediately after rise of last sclk pulse (rise mode); in fall mode, immediately after fall of last sclk pulse transmission sclk output mode immediately after rise of last sclk pulse interrupt generation timing (wbuf = 0) sclk input mode immediately after rise of last sclk pulse (rise mode); in fall mode, immediately after fall of last sclk pulse sclk output mode immediately after rise of last sclk pulse or immediately after data is transferred to transmit buffer 1 interrupt generation timing (wbuf = 1) sclk input mode immediately after rise of last sclk pulse (rise mode); in fall mode, immediately after fall of last sclk pulse; or immediately after data is transferred to transmit buffer 1 sclk output mode immediately after rise of last sclk pulse underrun error generation timing sclk input mode immediately after rise of next sclk pulse (rise mode); in fall mode, immediately after fall of next sclk pulse note 1: do not modify any control regist er during transmission or reception (while reception is enabled). note 2: do not disable reception (by setting sc0mod0 to 0) while data is being received.
tmp1942cy/cz tmp1942cy/cz-250 3.11.3 register description 7 6 5 4 3 2 1 0 bit symbol tb8 ctse rxe wu sm1 sm0 sc1 sc0 read/write r/w after reset 0 0 0 0 0 0 0 0 function transmit data bit 8 handsha-ki ng function control 0: disable cts 1: enable cts receive control 0: disable reception 1: enable reception wake-up function 0: disable 1: enable serial transfer mode 00: i/o interface mode 01: 7-bit uart mode 10: 8-bit uart mode 11: 9-bit uart mode serial transfer clock (for uart) 00: timer ta6trg 01: baud rate generator 10: internal clock f sys /2 11: external clock (sclk0 input) wake-up function 9-bit uart mode other modes 0 interrupt when data is received 1 interrupt only when rb8 = 1 don?t care handshaking function ( cts pin) enable 0 disable (continuous tr ansmission allowed) 1 enable note: do not set rxe to 1 while setting each m ode register (sc0mod0, sc0mod1, and sc0mod2). set rxe to 1 after setting all other register bits. figure 3.11.6 serial mode control register 0 (sc0mod0, for sio0) 7 6 5 4 3 2 1 0 bit symbol i2s0 fdpx0 sioen ? ? ? ? ? read/write r/w r/w r/w ? ? ? ? ? after reset 0 0 0 ? ? ? ? ? function idle 0: idle 1: running sync format 0:half-dupl ex 1:full-dupl ex sio operation 0: disable 1: enable : enables or disables a clock supply to sio module components other than registers. note: when setting sioen to 1, set it before setting i2s0 and fdpx0. figure 3.11.7 serial mode control register 1 (sc0mod1, for sio0) sc0mod0 (0xffff_f232) note: in i/o interface mode, the clock is selected using the serial control register (sc0cr). sc0mod1 (0xffff_f235)
tmp1942cy/cz tmp1942cy/cz-251 7 6 5 4 3 2 1 0 bit symbol tbemp rbfll txrun sblen drchg wbuf swrst1 swrst0 read/write r/w w w after reset 1 0 0 0 0 0 0 0 function transmit buffer empty flag 0: full 1: empty receive buffer full flag 0: empty 1: full transmi-ssi on in progress flag 0: stopped 1:transmi-t ting stop bit length 0: 1 bit 1: 2 bits direction of transfer 0: lsb first 1: msb first double-buff er enable 0: disable 1: enable soft reset writing 10 then 01 triggers a reset. : writing 10 and 01 in this order tri ggers a software reset. this initializes the mode register bits sc0mod0, sc0mod2, and , control register bits sc 0cr, and , and the internal logic. : enables or disables the double-buffer for transmission (sclk output/input) and reception (sclk output) in i/o interface mode and transmission in uart mode. in other modes, the double-buffer is always enabled regardless of the setting. : specifies the direction of transfer in i/o interface mode. in uart mode, this bit is fixed to 0 (lsb first). : this bit is a status flag which indicates whether transmission shift operation is in progress. when this bit is set to 1, it indicates that data is being transmitted. when this bit is set to 0, it indicates t hat transmission is completely finished (if tbemp = 1) or that the device is wait ing with next transmit data stored in the transmit buffer (if tbemp = 0). : this bit is a flag which indicates whether the receive double-buffer is full. rbfil is set to 1 when data has been tran sferred from the receive shift register to the receive double-buffer. it is cleared to 0 when the data has been read. this flag has no meaning if the double-buffer is disabled. : this bit is a flag which indicates whether the transmit double-buffer is empty. tbemp is set to 1 when data has been transferred from the transmit double-buffer to the transmit shift register, resulting in the transmit double-buffer being empty. it is cleared to 0 when transmit data has been written to the double-buffer. this fl ag has no meaning if the double-buffer is disabled. : specifies the transmit stop bit l ength in uart mode. during reception, the device always recognizes a single stop bi t regardless of the setting of this bit. note: if it is necessary to perform a soft reset during transmission, perform it twice consecutively. figure 3.11.8 serial mode control register 2 (sc0mod2, for sio0) sc0mod2 (0xffff_f236)
tmp1942cy/cz tmp1942cy/cz-252 7 6 5 4 3 2 1 0 bit symbol tb8 ctse rxe wu sm1 sm0 sc1 sc0 read/write r/w after reset 0 0 0 0 0 0 0 0 function transmit data bit 8 1: enable cts receive control 0: disable reception 1: enable reception wake-up function 0: disable 1: enable serial transfer mode 00: i/o interface mode 01: 7-bit uart mode 10: 8-bit uart mode 11: 9-bit uart mode serial transfer clock (for uart) 00: timer ta6trg 01: baud rate generator 10: internal clock f sys /2 11: external clock (sclk1 input) wake-up function 9-bit uart mode other modes 0 interrupt when data is received 1 interrupt only when rb8 = 1 don?t care note: do not set rxe to 1 while setting each m ode register (sc1mod0, sc1mod1, and sc1mod2). set rxe to 1 after setting all other register bits. figure 3.11.9 serial mode control register 0 (sc1mod0, for sio1) 7 6 5 4 3 2 1 0 bit symbol i2s0 fdpx0 sioen ? ? ? ? ? read/write r/w r/w r/w ? ? ? ? ? after reset 0 0 0 ? ? ? ? ? function i idle 0: idle 1: running sync format 0:half-dupl ex 1:full-dupl ex sio operation 0: disable 1: enable : enables or disables a clock s upply to sio module components other than registers. note: when setting sioen to 1, set it before setting i2s0 and fdpx0. figure 3.11.10 serial mode control register 1 (sc1mod1, for sio1) sc1mod0 (0xffff_f23a) note: in i/o interface mode, the clock is selected using the serial control register (sc1cr). sc1mod1 (0xffff_f23d)
tmp1942cy/cz tmp1942cy/cz-253 7 6 5 4 3 2 1 0 bit symbol tbemp rbfll txrun sblen drchg wbuf swrst1 swrst0 read/write r/w w w after reset 1 0 0 0 0 0 0 0 function transmit buffer empty flag 0: full 1: empty receive buffer full flag 0: empty 1: full transmi-ssi on in progress flag 0: stopped 1:transmi-t ting stop bit length 0: 1 bit 1: 2 bits direction of transfer 0: lsb first 1: msb first double-buff er enable 0: disable 1: enable soft reset writing 10 then 01 triggers a reset. : writing 10 and 01 in this order tri ggers a software reset. this initializes the mode register bits sc1mod0, sc1mod2, and , control register bits sc 1cr, and , and the internal logic. : enables or disables the double-buffer for transmission (sclk output/input) and reception (sclk output) in i/o interface mode and transmission in uart mode. in other modes, the double-buffer is always enabled regardless of the setting. : specifies the direction of transfer in i/o interface mode. in uart mode, this bit is fixed to 0 (lsb first). : this bit is a status flag which indi cates whether transmission shift operation is in progress. when this bit is set to 1, it indicates that data is being transmitted. when this bit is set to 0, it indicates t hat transmission is completely finished (if tbemp = 1) or that the device is wait ing with next transmit data stored in the transmit buffer (if tbemp = 0). : this bit is a flag which indicates whether the receive double-buffer is full. rbfil is set to 1 when data has been transferred from the receive shift register to the receive double-buffer. it is cleared to 0 when the data has been read. this flag has no meaning if the double-buffer is disabled. : this bit is a flag which indicates whether the transmit double-buffer is empty. tbemp is set to 1 when data has been transferred from the transmit double-buffer to the transmit shift register, resulting in the transmit double-buffer being empty. it is cleared to 0 when transmit data has been written to the double-buffer. this flag has no meaning if the double-buffer is disabled. : specifies the transmit stop bit l ength in uart mode. during reception, the device always recognizes a single stop bit regardless of the setting of this bit. note: if it is necessary to perform a soft reset during transmission, perform it twice consecutively. figure 3.11.11 serial mode control register 2 (sc1mod2, for sio1) sc0mod2 (0xffff_f23e)
tmp1942cy/cz tmp1942cy/cz-254 7 6 5 4 3 2 1 0 bit symbol tb8 ctse rxe wu sm1 sm0 sc1 sc0 read/write r/w after reset 0 0 0 0 0 0 0 0 function transmit data bit 8 1: enable cts receive control 0: disable reception 1: enable reception wake-up function 0: disable 1: enable serial transfer mode 00: i/o interface mode 01: 7-bit uart mode 10: 8-bit uart mode 11: 9-bit uart mode serial transfer clock (for uart) 00: timer ta6trg 01: baud rate generator 10: internal clock f sys /2 11: external clock (sclk1 input) wake-up function 9-bit uart mode other modes 0 interrupt when data is received 1 interrupt only when rb8 = 1 don?t care note: do not set rxe to 1 while setting each m ode register (sc3mod0, sc3mod1, and sc3mod2). set rxe to 1 after setting all other register bits. figure 3.11.12 serial mode control register 0 (sc3mod0, for sio3) 7 6 5 4 3 2 1 0 bit symbol i2s0 fdpx0 sioen ? ? ? ? ? read/write r/w r/w r/w ? ? ? ? ? after reset 0 0 0 ? ? ? ? ? function idle 0: idle 1: running sync format 0:half-dupl ex 1:full-dupl ex sio operation 0: disable 1: enable : enables or disables a clock s upply to sio module components other than registers. note: when setting sioen to 1, set it before setting i2s0 and fdpx0. figure 3.11.13 serial mode control register 1 (sc3mod1, for sio3) sc3mod0 (0x0ffff_f282) sc3mod1 (0xffff_f285)
tmp1942cy/cz tmp1942cy/cz-255 7 6 5 4 3 2 1 0 bit symbol tbemp rbfll txrun sblen drchg wbuf swrst1 swrst0 read/write r/w w w after reset 1 0 0 0 0 0 0 0 function transmit buffer empty flag 0: full 1: empty receive buffer full flag 0: empty 1: full transmi-ssi on in progress flag 0: stopped 1:transmi-t ting stop bit length 0: 1 bit 1: 2 bits direction of transfer 0: lsb first 1: msb first double-buff er enable 0: disable 1: enable soft reset writing 10 then 01 triggers a reset. : writing 10 and 01 in this order tri ggers a software reset. this initializes the mode register bits sc3mod0, sc3mod2, and , control register bits sc 3cr, and , and the internal logic. : enables or disables the double-buffer for transmission (sclk output/input) and reception (sclk output) in i/o interface mode and transmission in uart mode. in other modes, the double-buffer is always enabled regardless of the setting. : specifies the direction of transfer in i/o interface mode. in uart mode, this bit is fixed to 0 (lsb first). : this bit is a status flag which indi cates whether transmission shift operation is in progress. when this bit is set to 1, it indicates that data is being transmitted. when this bit is set to 0, it indicates t hat transmission is completely finished (if tbemp = 1) or that the device is wait ing with next transmit data stored in the transmit buffer (if tbemp = 0). : this bit is a flag which indicates whether the receive double-buffer is full. rbfil is set to 1 when data has been transferred from the receive shift register to the receive double-buffer. it is cleared to 0 when the data has been read. this flag has no meaning if the double-buffer is disabled. : this bit is a flag which indicates whether the transmit double-buffer is empty. tbemp is set to 1 when data has been transferred from the transmit double-buffer to the transmit shift register, resulting in the transmit double-buffer being empty. it is cleared to 0 when transmit data has been written to the double-buffer. this flag has no meaning if the double-buffer is disabled. : specifies the transmit stop bit length in uart mode. note: if it is necessary to perform a soft reset dur ing transmission, perform it twice consecutively. figure 3.11.14 serial mode control register 2 (sc3mod2, for sio3)
tmp1942cy/cz tmp1942cy/cz-256 7 6 5 4 3 2 1 0 bit symbol tb8 ctse rxe wu sm1 sm0 sc1 sc0 read/write r/w after reset 0 0 0 0 0 0 0 0 function transmit data bit 8 1: enable cts receive control 0: disable reception 1: enable reception wake-up function 0: disable 1: enable serial transfer mode 00: reserved 01: 7-bit uart mode 10: 8-bit uart mode 11: 9-bit uart mode serial transfer clock (for uart) 00: timer ta6trg 01: baud rate generator 10: internal clock f sys /2 11: don?t care wake-up function 9-bit uart mode other modes 0 interrupt when data is received 1 interrupt only when rb8 = 1 don?t care note: do not set rxe to 1 while setting each m ode register (sc4mod0, sc4mod1, and sc4mod2). set rxe to 1 after setting all other register bits. figure 3.11.15 serial mode control register 0 (sc4mod0, for sio4) 7 6 5 4 3 2 1 0 bit symbol i2s0 fdpx0 sioen ? ? ? ? ? read/write r/w r/w r/w ? ? ? ? ? after reset 0 0 0 ? ? ? ? ? function idle 0: idle 1: running sync format 0:half-dupl ex 1:full-dupl ex sio operation 0: disable 1: enable : enables or disables a clock s upply to sio module components other than registers. note: when setting sioen to 1, set it before setting i2s0 and fdpx0. figure 3.11.16 serial mode control register 1 (sc4mod1, for sio4) sc4mod0 (0xffff_f28a) sc4mod1 (0xffff_f28d)
tmp1942cy/cz tmp1942cy/cz-257 7 6 5 4 3 2 1 0 bit symbol tbemp rbfll txrun sblen drchg wbuf swrst1 swrst0 read/write r/w w w after reset 1 0 0 0 0 0 0 0 function transmit buffer empty flag 0: full 1: empty receive buffer full flag 0: empty 1: full transmi-ssi on in progress flag 0: stopped 1:transmi-t ting stop bit length 0: 1 bit 1: 2 bits direction of transfer 0: lsb first 1: msb first double-buf fer enable 0: disable 1: enable soft reset writing 10 then 01 triggers a reset. : writing 10 and 01 in this order tri ggers a software reset. this initializes the mode register bits sc4mod0, sc4mod2, and , control register bits sc 4cr, and , and the internal logic. : enables or disables the double-buffer for transmission (sclk output/input) and reception (sclk output) in i/o interface mode and transmission in uart mode. in other modes, the double-buffer is always enabled regardless of the setting. : specifies the direction of transfer in i/o interface mode. in uart mode, this bit is fixed to 0 (lsb first). : this bit is a status flag which indi cates whether transmission shift operation is in progress. when this bit is set to 1, it indicates that data is being transmitted. when this bit is set to 0, it indicates t hat transmission is completely finished (if tbemp = 1) or that the device is wait ing with next transmit data stored in the transmit buffer (if tbemp = 0). : this bit is a flag which indicates whether the receive double-buffer is full. rbfil is set to 1 when data has been transferred from the receive shift register to the receive double-buffer. it is cleared to 0 when the data has been read. this flag has no meaning if the double-buffer is disabled. : this bit is a flag which indicates whether the transmit double-buffer is empty. tbemp is set to 1 when data has been transferred from the transmit double-buffer to the transmit shift register, resulting in the transmit double-buffer being empty. it is cleared to 0 when transmit data has been written to the double-buffer. this flag has no meaning if the double-buffer is disabled. : specifies the transmit stop bit l ength in uart mode. during reception, the device always recognizes a single stop bit regardless of the setting of this bit. note: if it is necessary to perform a soft reset dur ing transmission, perform it twice consecutively. figure 3.11.17 serial mode control register 2 (sc4mod2, for sio4) sc4mod2 (0xffff_f28e)
tmp1942cy/cz tmp1942cy/cz-258 7 6 5 4 3 2 1 0 bit symbol tb8 ctse rxe wu sm1 sm0 sc1 sc0 read/write r/w after reset 0 0 0 0 0 0 0 0 function transmit data bit 8 1: enable cts receive control 0: disable reception 1: enable reception wake-up function 0: disable 1: enable serial transfer mode 00: reserved 01: 7-bit uart mode 10: 8-bit uart mode 11: 9-bit uart mode serial transfer clock (for uart) 00: timer ta6trg 01: baud rate generator 10: internal clock f sys /2 11: don?t care wake-up function 9-bit uart mode other modes 0 interrupt when data is received 1 interrupt only when rb8 = 1 don?t care note: do not set rxe to 1 while setting each mode register (sc5mod0, sc5mod1, and sc5mod2). set rxe to 1 after setting all other register bits. figure 3.11.18 serial mode control register 0 (sc5mod0, for sio5) 7 6 5 4 3 2 1 0 bit symbol i2s0 fdpx0 sioen ? ? ? ? ? read/write r/w r/w r/w ? ? ? ? ? after reset 0 0 0 ? ? ? ? ? function i idle 0: idle 1: running sync format 0:half-dupl ex 1:full-dupl ex sio operation 0: disable 1: enable : enables or disables a clock s upply to sio module components other than registers. note: when setting sioen to 1, set it before setting i2s0 and fdpx0. figure 3.11.19 serial mode control register 1 (sc5mod1, for sio5) sc5mod0 (0xffff_f292) sc5mod1 (0xffff_f295)
tmp1942cy/cz tmp1942cy/cz-259 7 6 5 4 3 2 1 0 bit symbol tbemp rbfll txrun sblen drchg wbuf swrst1 swrst0 read/write r/w w w after reset 1 0 0 0 0 0 0 0 function transmit buffer empty flag 0: full 1: empty receive buffer full flag 0: empty 1: full transmi-ssi on in progress flag 0: stopped 1: transmi- tting stop bit length 0: 1 bit 1: 2 bits direction of transfer 0: lsb first 1: msb first double-buf fer enable 0: disable 1: enable soft reset writing 10 then 01 triggers a reset. : writing 10 and 01 in this order tri ggers a software reset. this initializes the mode register bits sc5mod0, sc5mod2, and , control register bits sc 5cr, and , and the internal logic. : enables or disables the double-buffer for transmission (sclk output/input) and reception (sclk output) in i/o interface mode and transmission in uart mode. in other modes, the double-buffer is always enabled regardless of the setting. : specifies the direction of transfer in i/o interface mode. in uart mode, this bit is fixed to 0 (lsb first). : this bit is a status flag which indi cates whether transmission shift operation is in progress. when this bit is set to 1, it indicates that data is being transmitted. when this bit is set to 0, it indicates t hat transmission is completely finished (if tbemp = 1) or that the device is wait ing with next transmit data stored in the transmit buffer (if tbemp = 0). : this bit is a flag which indicates whether the receive double-buffer is full. rbfil is set to 1 when data has been transferred from the receive shift register to the receive double-buffer. it is cleared to 0 when the data has been read. this flag has no meaning if the double-buffer is disabled. : this bit is a flag which indicates whether the transmit double-buffer is empty. tbemp is set to 1 when data has been transferred from the transmit double-buffer to the transmit shift register, resulting in the transmit double-buffer being empty. it is cleared to 0 when transmit data has been written to the double-buffer. this flag has no meaning if the double-buffer is disabled. : specifies the transmit stop bit l ength in uart mode. during reception, the device always recognizes a single stop bit regardless of the setting of this bit. note: if it is necessary to perform a soft reset dur ing transmission, perform it twice consecutively. figure 3.11.20 serial mode control register 2 (sc5mod2, for sio5) sc5mod2 (0xffff_f296)
tmp1942cy/cz tmp1942cy/cz-260 7 6 5 4 3 2 1 0 bit symbol rb8 even pe oerr perr ferr sclks ioc read/write r r/w r (cleared to 0 when read) r/w after reset ? 0 0 0 0 0 0 0 1: error function receive data bit 8 parity type 0: odd 1: even parity 0: disabled 1: enabled overrun parity /underrun framing 0: sclk0 1: sclk0 0: baud rate generator 1: sclk0 pin input i/o interface input clock selection 0 baud rate generator 1 sclk0 pin input active edge selection for sclk0 input 0 data transmitted/received at rising edge of sclk0 1 data transmitted/received at falling edge of sclk0 framing error flag parity error/underrun error flag overrun error flag cleared to 0 when read parity type 0 odd parity 1 even parity note 1: all error flags are cleared to 0 when read. note 2: for sclk output operation, set sclks to 0 (rising edge). figure 3.11.21 serial contro l register (sc0cr, for sio0) sc0cr (0xffff_f231)
tmp1942cy/cz tmp1942cy/cz-261 7 6 5 4 3 2 1 0 bit symbol rb8 even pe oerr perr ferr sclks ioc read/write r r/w r (cleared to 0 when read) r/w after reset ? 0 0 0 0 0 0 0 1: error function receive data bit 8 parity type 0: odd 1: even parity 0: disabled 1: enabled overrun parity/ underrun framing 0: sclk0 1: sclk0 0: baud rate generator 1: sclk0 pin input i/o interface input clock selection 0 baud rate generator 1 sclk0 pin input active edge selection for sclk0 input 0 data transmitted/received at rising edge of sclk0 1 data transmitted/received at falling edge of sclk0 framing error flag parity error/underrun error flag overrun error flag cleared to 0 when read parity type 0 odd parity 1 even parity note 1: all error flags are cleared to 0 when read. note 2: for sclk output operation, set sclks to 0 (rising edge). figure 3.11.22 serial contro l register (sc1cr, for sio1) sc1cr (0xffff_f239)
tmp1942cy/cz tmp1942cy/cz-262 7 6 5 4 3 2 1 0 bit symbol rb8 even pe oerr perr ferr sclks ioc read/write r r/w r (cleared to 0 when read) r/w after reset ? 0 0 0 0 0 0 0 1: error function receive data bit 8 parity type 0: odd 1: even parity 0: disabled 1: enabled overrun parity/ underrun framing 0: sclk0 1: sclk0 0: baud rate generator 1: sclk0 pin input i/o interface input clock selection 0 baud rate generator 1 sclk0 pin input active edge selection for sclk0 input 0 data transmitted/received at rising edge of sclk0 1 data transmitted/received at falling edge of sclk0 framing error flag parity error/underrun error flag overrun error flag cleared to 0 when read parity type 0 odd parity 1 even parity : in both uart and i/o interface modes, an overrun error occurs when all bits of the next frame have been received before data stored in the receive buffer is read out completely. an overrun error causes the oerr flag to be set. : in uart mode, the perr flag is set to 1 when a parity error occurs. reading the perr flag clears it to 0. in i/o interfac e mode, the perr bit indicates an underrun error. when sc0mod2 is set to 1, an underrun error occurs in the following case: in sclk input mode, it occurs if data stored in the transmit shift register has been transmitted but no data is set in the transmit double-buffer. in other modes, this flag is not set. reading the flag clears it to 0. : in uart mode, the ferr flag is set to 1 when a framing error occurs. reading the flag clears it to 0. note 1: all error flags are cleared to 0 when read. note 2: for sclk output operation, set sclks to 0 (rising edge). figure 3.11.23 serial contro l register (sc3cr, for sio3) sc3cr (0xffff_f281)
tmp1942cy/cz tmp1942cy/cz-263 7 6 5 4 3 2 1 0 bit symbol rb8 even pe oerr perr ferr sclks ioc read/write r r/w r (cleared to 0 when read) r/w after reset ? 0 0 0 0 0 0 0 1: error function receive data bit 8 parity type 0: odd 1: even parity 0: disabled 1: enabled overrun parity/ underrun framing 0: sclk0 1: sclk0 0: baud rate generator 1: sclk0 pin input i/o interface input clock selection 0 baud rate generator 1 sclk0 pin input active edge selection for sclk0 input 0 data transmitted/received at rising edge of sclk0 1 data transmitted/received at falling edge of sclk0 framing error flag parity error/underrun error flag overrun error flag cleared to 0 when read parity type 0 odd parity 1 even parity note 1: all error flags are cleared to 0 when read. note 2: for sclk output operation, set sclks to 0 (rising edge). figure 3.11.24 serial control register (sc4cr, for sio4) sc4cr (0xffff_f289)
tmp1942cy/cz tmp1942cy/cz-264 7 6 5 4 3 2 1 0 bit symbol rb8 even pe oerr perr ferr sclks ioc read/write r r/w r (cleared to 0 when read) r/w after reset ? 0 0 0 0 0 0 0 1: error function receive data bit 8 parity type 0: odd 1: even parity 0: disabled 1: enabled overrun parity/ underrun framing 0: sclk0 1: sclk0 0: baud rate generator 1: sclk0 pin input i/o interface input clock selection 0 baud rate generator 1 sclk0 pin input active edge selection for sclk0 input 0 data transmitted/received at rising edge of sclk0 1 data transmitted/received at falling edge of sclk0 framing error flag parity error/underrun error flag overrun error flag cleared to 0 when read parity type 0 odd parity 1 even parity note 1: all error flags are cleared to 0 when read. note 2: for sclk output operation, set sclks to 0 (rising edge). figure 3.11.25 serial contro l register (sc5cr, for sio5) sc5cr (0xffff_f293)
tmp1942cy/cz tmp1942cy/cz-265 7 6 5 4 3 2 1 0 bit symbol ? br0adde br0ck1 br0ck0 br0s3 br0s2 br0s1 br0s0 read/write r/w after reset 0 0 0 0 0 0 0 0 function must always be set to 0. division by n+(16-k)/16 0: disable 1: enable 00: t0 01: t2 10: t8 11: t32 sets value of divisor n selects baud rate generator input clock 00 internal clock t0 01 internal clock t2 10 internal clock t8 11 internal clock t32 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? br0k3 br0k2 br0k1 br0k0 read/write ? ? ? ? r/w after reset ? ? ? ? 0 0 0 0 function sets k value for division by n + (16-k)/16 sets divisor value for baud rate generator br0cr = 1 br0cr = 0 br0cr br0add 0000 (n = 16) 0001 (n = 1) 0010 (n = 2) 1111 (n = 15) 0001 (n = 1) (only uart) 1111 (n = 15) 0000 (n = 16) 0000 invalid invalid ? 0001 (k = 1) 1111 (k = 15) invalid divided by n + (16-k)/16 divided by n note 1: the baud rate generator divisor cannot be set to 1 in uart mode if division by n+(16-k)/16 is being used. it cannot be set to 1 at all in i/o interface mode. note 2: when using division by n+(16-k)/16, be sure to set k (1 to 15) in br0add before setting br0cr to 1. however, if br0cr = 0000 or 0001 (i.e. if n = 16 or 1), do not use division by n+(16-k)/16. note 3: division by n+(16-k)/16 can only be us ed in uart mode. in i/o interface mode, set br0cr to 0 to disable division by n+(16-k)/16. figure 3.11.26 baud rate generator contro l registers (br0cr and br0add, for sio0) ~ br0cr (0xffff_f233) ~ ~ ~ br0add (0xffff_f234)
tmp1942cy/cz tmp1942cy/cz-266 7 6 5 4 3 2 1 0 bit symbol ? br1adde br1ck1 br1ck0 br1s3 br1s2 br1s1 br1s0 read/write r/w after reset 0 0 0 0 0 0 0 0 function must always be set to 0. division by n+(16-k)/16 0: disable 1: enable 00: t0 01: t2 10: t8 11: t32 sets value of divisor n selects baud rate generator input clock 00 internal clock t0 01 internal clock t2 10 internal clock t8 11 internal clock t32 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? br1k3 br1k2 br1k1 br1k0 read/write ? ? ? ? r/w after reset ? ? ? ? 0 0 0 0 function sets k value for divi sion by n+(16-k)/16 sets divisor value for baud rate generator br0cr = 1 br0cr = 0 br0cr br0add 0000 (n = 16) 0001 (n = 1) 0010 (n = 2) 1111 (n = 15) 0001 (n = 1) (only uart) 1111 (n = 15) 0000 (n = 16) 0000 invalid invalid ? 0001 (k = 1) 1111 (k = 15) invalid divided by n + (16-k)/16 divided by n note 1: the baud rate generator divisor cannot be set to 1 in uart mode if division by n+(16-k)/16 is being used. it cannot be set to 1 at all in i/o interface mode. note 2: when using division by n+(16-k)/16, be sure to set k (1 to 15) in br1add before setting br1cr to 1. however, if br1cr = 0000 or 0001 (i.e. if n = 16 or 1), do not use division by n+(16-k)/16. note 3: division by n+(16-k)/16 can only be us ed in uart mode. in i/o interface mode, set br1cr to 0 to disable division by n+(16-k)/16. figure 3.11.27 baud rate generator contro l registers (br1cr and br1add, for sio1) ~ ~ ~ br1cr (0xffff_f23b) br1add (0xffff_f23c) ~
tmp1942cy/cz tmp1942cy/cz-267 7 6 5 4 3 2 1 0 bit symbol ? br3adde br3ck1 br3ck0 br3s3 br3s2 br3s1 br3s0 read/write r/w after reset 0 0 0 0 0 0 0 0 function must always be set to 0. division by n+(16-k)/16 0: disable 1: enable 00: t0 01: t2 10: t8 11: t32 sets value of divisor n selects baud rate generator input clock 00 internal clock t0 01 internal clock t2 10 internal clock t8 11 internal clock t32 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? br3k3 br3k2 br3k1 br3k0 read/write ? ? ? ? r/w after reset ? ? ? ? 0 0 0 0 function sets k value for divi sion by n+(16-k)/16 sets divisor value for baud rate generator br0cr = 1 br0cr = 0 br0cr br0add 0000 (n = 16) 0001 (n = 1) 0010 (n = 2) 1111 (n = 15) 0001 (n = 1) (only uart) 1111 (n = 15) 0000 (n = 16) 0000 invalid invalid ? 0001 (k = 1) 1111 (k = 15) invalid divided by n + (16-k)/16 divided by n note 1: the baud rate generator divisor cannot be set to 1 in uart mode if division by n+(16-k)/16 is being used. it cannot be set to 1 at all in i/o interface mode. note 2: when using division by n+(16-k)/16, be sure to set k (1 to 15) in br3add before setting br3cr to 1. however, if br3cr = 0000 or 0001 (i.e. if n = 16 or 1), do not use division by n+(16-k)/16. note 3: division by n+(16-k)/16 can only be us ed in uart mode. in i/o interface mode, set br3cr to 0 to disable division by n+(16-k)/16. figure 3.11.28 baud rate generator contro l registers (br3cr and br3add, for sio3) ~ ~ ~ br3cr (0xffff_f283) br3add (0xffff_f284) ~
tmp1942cy/cz tmp1942cy/cz-268 7 6 5 4 3 2 1 0 bit symbol ? br4adde br4ck1 br4ck0 br4s3 br4s2 br4s1 br4s0 read/write r/w after reset 0 0 0 0 0 0 0 0 function must always be set to 0. division by n+(16-k)/16 0: disable 1: enable 00: t0 01: t2 10: t8 11: t32 sets value of divisor n selects baud rate generator input clock 00 internal clock t0 01 internal clock t2 10 internal clock t8 11 internal clock t32 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? br4k3 br4k2 br4k1 br4k0 read/write ? ? ? ? r/w after reset ? ? ? ? 0 0 0 0 function sets k value for divi sion by n+(16-k)/16 sets divisor value for baud rate generator br0cr = 1 br0cr = 0 br0cr br0add 0000 (n = 16) 0001 (n = 1) 0010 (n = 2) 1111 (n = 15) 0001 (n = 1) (only uart) 1111 (n = 15) 0000 (n = 16) 0000 invalid invalid ? 0001 (k = 1) 1111 (k = 15) invalid divided by n + (16-k)/16 divided by n note 1: the baud rate generator divisor cannot be set to 1 in uart mode if division by n+(16-k)/16 is being used. it cannot be set to 1 at all in i/o interface mode. note 2: when using division by n+(16-k)/16, be sure to set k (1 to 15) in br4add before setting br4cr to 1. however, if br4cr = 0000 or 0001 (i.e. if n = 16 or 1), do not use division by n+(16-k)/16. note 3: division by n+(16-k)/16 can only be us ed in uart mode. in i/o interface mode, set br4cr to 0 to disable division by n+(16-k)/16. figure 3.11.29 baud rate generator contro l registers (br4cr and br4add, for sio4) ~ ~ ~ br4cr (0xffff_f28b) br4add (0xffff_f28c) ~
tmp1942cy/cz tmp1942cy/cz-269 7 6 5 4 3 2 1 0 bit symbol ? br5adde br5ck1 br5ck0 br5s3 br5s2 br5s1 br5s0 read/write r/w after reset 0 0 0 0 0 0 0 0 function must always be set to 0. division by n+(16-k)/16 0: disable 1: enable 00: t0 01: t2 10: t8 11: t32 sets value of divisor n selects baud rate generator input clock 00 internal clock t0 01 internal clock t2 10 internal clock t8 11 internal clock t32 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? br5k3 br5k2 br5k1 br5k0 read/write ? ? ? ? r/w after reset ? ? ? ? 0 0 0 0 function sets k value for divi sion by n+(16-k)/16 sets divisor value for baud rate generator br0cr = 1 br0cr = 0 br0cr br0add 0000 (n = 16) 0001 (n = 1) 0010 (n = 2) 1111 (n = 15) 0001 (n = 1) (only uart) 1111 (n = 15) 0000 (n = 16) 0000 invalid invalid ? 0001 (k = 1) 1111 (k = 15) invalid divided by n + (16-k)/16 divided by n note 1: the baud rate generator divisor cannot be set to 1 in uart mode if division by n+(16-k)/16 is being used. it cannot be set to 1 at all in i/o interface mode. note 2: when using division by n+(16-k)/16, be sure to set k (1 to 15) in br5add before setting br5cr to 1. however, if br5cr = 0000 or 0001 (i.e. if n = 16 or 1), do not use division by n+(16-k)/16. note 3: division by n+(16-k)/16 can only be us ed in uart mode. in i/o interface mode, set br5cr to 0 to disable division by n+(16-k)/16. figure 3.11.30 baud rate generator contro l registers (br5cr and br5add, for sio5) ~ ~ ~ br5cr (0xffff_f293) br5add (0xffff_f294) ~
tmp1942cy/cz tmp1942cy/cz-270 7 6 5 4 3 2 1 0 tb7 tb6 tb5 tb4 tb3 tb2 tb1 tb0 (for transmission) sc0buf (0xffff_f230) 7 6 5 4 3 2 1 0 rb7 rb6 rb5 rb4 rb3 rb2 rb1 rb0 (for reception) figure 3.11.31 serial transmit/receive buffer register (sc0buf, for sio0) 7 6 5 4 3 2 1 0 tb7 tb6 tb5 tb4 tb3 tb2 tb1 tb0 (for transmission) sc1buf (0xffff_f238) 7 6 5 4 3 2 1 0 rb7 rb6 rb5 rb4 rb3 rb2 rb1 rb0 (for reception) figure 3.11.32 serial transmit/receive buffer register (sc1buf, for sio1) 7 6 5 4 3 2 1 0 tb7 tb6 tb5 tb4 tb3 tb2 tb1 tb0 (for transmission) sc3buf (0xffff_f280) 7 6 5 4 3 2 1 0 rb7 rb6 rb5 rb4 rb3 rb2 rb1 rb0 (for reception) figure 3.11.33 serial transmit/receive buffer register (sc3buf, for sio3) 7 6 5 4 3 2 1 0 tb7 tb6 tb5 tb4 tb3 tb2 tb1 tb0 (for transmission) sc4buf (0xffff_f288) 7 6 5 4 3 2 1 0 rb7 rb6 rb5 rb4 rb3 rb2 rb1 rb0 (for reception) figure 3.11.34 serial transmit/receive buffer register (sc4buf, for sio4) 7 6 5 4 3 2 1 0 tb7 tb6 tb5 tb4 tb3 tb2 tb1 tb0 (for transmission) sc5buf (0xffff_f290) 7 6 5 4 3 2 1 0 rb7 rb6 rb5 rb4 rb3 rb2 rb1 rb0 (for reception) figure 3.11.35 serial transmit/receive buffer register (sc5buf, for sio5)
tmp1942cy/cz 3.11 11 3.11.4 functional description for each mode 3.11.4 functional description for each mode (1) mode 0 (i/o interface mode) (1) mode 0 (i/o interface mode) this mode comprises two submodes: sclk output mode, in which the synchronizing clock sclk is generated internally by the device, and sclk input mode, in which the synchronizing clock sclk is input from an external source. this mode comprises two submodes: sclk output mode, in which the synchronizing clock sclk is generated internally by the device, and sclk input mode, in which the synchronizing clock sclk is input from an external source. 1) transmission 1) transmission if wbuf = 0, that is, the transmit double-buffer is disabled in sclk output mode, 8 bits of data and the synchronizing clock signal are output on the txd0 and sclk0 pins, respectively, each time the cpu writes data to the transmit buffer. when all the data bits have been output, an inttx0 interrupt is generated. if wbuf = 0, that is, the transmit double-buffer is disabled in sclk output mode, 8 bits of data and the synchronizing clock signal are output on the txd0 and sclk0 pins, respectively, each time the cpu writes data to the transmit buffer. when all the data bits have been output, an inttx0 interrupt is generated. if wbuf = 1, that is, the transmit double-buffer is enabled, data is transferred from transmit buffer 2 to transmit buffer 1 when the cpu write s data to transmit buffer 2 while transmission is stopped or when data has been transmitted from transmit buffer 1 (shift register). simultaneously, sc0mod2 is set to 1 an d an inttx0 interrupt occurs. if transmit buffer 2 does not contain data to be transferred to transmit buffer 1, sclk0 output is stopped without generating an inttx0 interrupt. if wbuf = 1, that is, the transmit double-buffer is enabled, data is transferred from transmit buffer 2 to transmit buffer 1 when the cpu write s data to transmit buffer 2 while transmission is stopped or when data has been transmitted from transmit buffer 1 (shift register). simultaneously, sc0mod2 is set to 1 an d an inttx0 interrupt occurs. if transmit buffer 2 does not contain data to be transferred to transmit buffer 1, sclk0 output is stopped without generating an inttx0 interrupt. timing at which transmit data is written to buffer sclk0 output bit 0 bit 6 bit 7 bit 1 txd0 (inttx0 interrupt request) bit 0 tbrun when wbuf = 0 timing at which transmit data is written to buffer sclk0 output bit 0 bit 6 bit 7 bit 1 txd0 (inttx0 interrupt request) bit 0 tbrun tbemp when wbuf = 1 ( if buffe r 2 contains data ) timing at which transmit data is written to buffer sclk0 output bit 0 bit 6 bit 7 bit 1 tmp1942cy/cz-271 figure 3.11.36 transmit operation in i/o interface mode (sclk0 output mode) figure 3.11.36 transmit operation in i/o interface mode (sclk0 output mode) txd0 (inttx0 interrupt request) tbrun tbemp when wbuf = 1 (if buffer 2 does not contain data)
tmp1942 cy/cz tmpr1942cy/cz-272 if wbuf = 0, that is, the transmit double-buffer is disabled in sclk input mode, 8 bits of data are output on the txd0 pin when the sclk0 input becomes active with data present in the transmit buffer. when all the data bits have been output, an inttx0 interrupt is generated. writing the next transmit data must be completed before point a in the shown below. if wbuf = 1, that is, the transmit double-buffer is enabled, data is transferred from transmit buffer 2 to transmit buffer 1 when the cpu write s data to the transmit buffer before the sclk0 input becomes active or when data has been transmitted from transmit buffer 1 (shift register). simultaneously, sc0mod2 is set to 1 and an inttx0 interrupt occurs. if the sclk0 input becomes active when transmit buffer 2 does not contain data, the internal bit counter starts counting but an underrun error flag is set, causing 8 bits of dummy data (ffh) to be transmitted. figure 3.11.37 transmit operation in i/o interface mode (sclk0 input mode) sclk0 input (sclks =0: rise mode) sclk0 input (sclks =1: fall mode) bit 0 bit 1 txd0 (inttx0 interrupt request) bit 5 bit 6 bit 7 timing at which transmit data is written to buffer bit 0 bit 1 a when wbuf = 0 sclk0 input (sclks =0: rise mode) sclk0 input (sclks =1: fall mode) bit 0 bit 1 txd0 (inttx0 interrupt request) bit 5 bit 6 bit 7 timing at which transmit data is written to buffer bit 0 bit 1 a tbrun tbemp when wbuf = 1 (if buffer 2 contains data) sclk0 input (sclks =0: rise mode) sclk0 input (sclks =1: fall mode) bit 0 bit 1 txd0 (inttx0 interrupt request) bit 5 bit 6 bit 7 timing at which transmit data is written to buffer 1 1 a tbrun tbemp perr (indicating underrun error) when wbuf = 1 (if buffer 2 does not contain data)
tmp1942cy/cz 2) reception if wbuf = 0, that is, the receive double-buffer is disabled in sclk output mode, the synchronizing clock is output on the sclk0 pin a nd the next data item is shifted into receive buffer 1 each time the received data is read by the cpu. when 8 bits of data have been received, an intrx0 interrupt is generated. sclk output is initiated by setting sc0mod0 to 1. if wbuf = 1, that is, the receive double-buffer is enabled, the received frame is transferred to transmit buffer 2 and then the next frame is received into receive buffer 1. when data has been transferred fr om receive buffer 1 to receive buffer 2, scnmod2 is set to 1 and an intrx0 interrupt occurs. if the cpu/dmac does not read data from receive buffer 2 before the next eight bits of data have been received, an overrun error occu rs, setting scncr. in that case, sclk0 output is stopped without generating an intrx0 interrupt. after an overrun error occurs, reading data from receive buffer 2 causes the da ta in receive buffer 1 to be transferred to receive buffer 2, generating an intr x0 interrupt to restart reception. timing at which received data is written to buffer sclk0 output bit 0 bit 6 bit 7 bit 1 rxd0 (intrx0 interrupt request) bit 0 when wbuf = 0 timing at which received data is written to buffer sclk0 output bit 0 bit 6 bit 7 bit 1 rxd0 (intrx0 interrupt request) bit 0 bit7 rbfull when wbuf = 1 (if data is read from buffer 2) timing at which received data is written to buffer sclk0 output bit 0 bit 6 bit 7 bit 1 rxd0 (intrx0 interrupt request) bit7 rbfull when wbuf = 1 (if data is not read from buffer 2) figure 3.11.38 receive operation in i/o interface mode (sclk0 output mode) tmp1942cy/cz-273
tmp1942 cy/cz in sclk input mode, the receive double-buffe r is always enabled. the received frame is transferred to receive buffer 2, so that receive buffer 1 can receive the next frame immediately. each time received data has been transferred to receive buffer 2, an intrx0 interrupt occurs. sclk0 input (sclks =0: rise mode) sclk0 input (sclks =1: fall mode) bit 0 bit 1 rxd0 (intrx0 interrupt request) bit 5 bit 6 bit 7 timing at which received data is written to buffer bit 0 rbfull if data is read from buffe r 2 sclk0 input (sclks =0: rise mode) sclk0 input (sclks =1: fall mode) bit 0 bit 1 rxd0 (intrx0 interrupt request) bit 5 bit 6 bit 7 timing at which received data is written to buffer bit 0 rbfull oerr figure 3.11.39 receive operation in i/o interface mode (sclk0 input mode) note: before receive operation can be performed in either sclk input mode or sclk output mode, reception must be enabled by setting sc0mod to 1. 3) transmission/reception (full-duplex) setting sc0mod1 to 1 enables full-duplex communication. if wbuf = 0, that is, both the transmit and receive double-bu ffers are disabled in sclk output mode, writing data to the transmit buffer initiates sclk output and shifts the received 8-bit data into receive buffer 1, generating a receive interrupt (intrx0 ). simultaneously, the 8-bit data written to the transmit buffer is output on the txd0 pin. when all bits of data have been transmitted, a transmit interrupt (inttx0) is generated, causing sclk output to stop. when the cpu subsequently reads the receive buffer and writes data to the transmit buffer, next transmission/reception starts. transmission/reception is restarted when the cpu has performed both the read and write , regardless of their sequence. tmpr1942cy/cz-274
tmp1942cy/cz tmp1942cy/cz-275 if wbuf = 1, that is, both the transmit and receive double-buffers are enabled, writing data to the transmit buffer initiates sclk output and shifts the r eceived 8-bit data into receive buffer 1, which is then transferred to receive bu ffer 2, generating a r eceive interrupt (intrx0). simultaneously, the 8-bit data written to the transmit buffer is output on the txd0 pin. when all bits of data have been transmitted, a tran smit interrupt (inttx0) is generated and the next data is transferred from transmit buffer 2 to tr ansmit buffer 1. if transmit buffer 2 does not contain data to be transferred (tbemp = 1) or receive buffer 2 contains data (rbfll = 1), sclk output is stopped. when the cpu subsequently reads the receive buffer and writes data to the transmit buffer, sclk output is rest arted and next transm ission/reception starts. figure 3.11.40 transmit/receive operation in i/o interface mode (sclk0 output mode) timing at which received data is written to buffer sclk0 output bit 0 bit 6 bit 7 bit 1 txd0 (inttx0 interrupt request) bit 0 timing at which transmit data is written to buffer (intrx0 interrupt request) bit 5 bit 1 bit 0 bit 6 bit 7 bit 1 rxd0 bit 0 bit 5 bit 1 when wbuf = 0 timing at which received data is written to buffer sclk0 output bit 0 bit 6 bit 7 bit 1 txd0 (inttx0 interrupt request) bit 0 timing at which transmit data is written to buffer (intrx0 interrupt request) bit 5 bit 1 bit 0 bit 6 bit 7 bit 1 rxd0 bit 0 bit 5 bit 1 when wbuf = 1 timing at which received data is written to buffer sclk0 output bit 0 bit 6 bit 7 bit 1 txd0 (inttx0 interrupt request) timing at which transmit data is written to buffer (intrx0 interrupt request) bit 5 bit 0 bit 6 bit 7 bit 1 rxd0 bit 5 when wbuf = 1
tmp1942 cy/cz if wbuf = 0, that is, the transmit double-buffer is disabled in sclk input mode (the receive double-buffer is always enabled in sclk input mode), 8-bit data is output on the txd0 pin and 8-bit data is shifted into the receive buff er simultaneously when the sclk input becomes active with data present in the transmit buffer. wh en all bits of data have been transmitted, a transmit interrupt (inttx0) is generated. when all bits of data have been received and then transferred from receive buffer 1 to receive buffer 2, a receive interrupt (intrx0) is generated. next transmit data must be written to the transmit buffer before the sclk pulse for the next frame is input, that is, before point a in the fi gure below. because the receive double-buffer is enabled, the received data must be read before the reception of the next frame is completed. if wbuf = 1, that is, both the transmit and recei ve double-buffers are enabled, the data in transmit buffer 2 is transferred to transmit buffer 1, generating a transmit interrupt (inttx0), when all bits of data in transmit buffer 1 have been transmitted. when the received 8-bit data has been shifted into receive buffer 1, the data is transferred to receive buffer 2, generating a receive interrupt (intrx0). th en, the sclk input pulse for the next frame initiates the transmission of the data transferred from transmit buffer 2 to transmit buffer 1 and the reception of data into receive buffer 1. if the data in receive buffer 2 is not read before the last bit of the frame is received, an overrun error oc curs. if transmit data is not written to transmit buffer 2 before the sclk pulse for the next frame is input, an underrun error occurs. timing at which received data is written to buffer sclk0 input bit 0 bit 6 bit 7 bit 1 txd0 (inttx0 interrupt request) bit 0 timing at which transmit data is written to buffer (intrx0 interrupt request) bit 5 bit 1 bit 0 bit 6 bit 7 bit 1 rxd0 bit 0 bit 5 bit 1 a when wbuf = 0 tmpr1942cy/cz-276
tmp1942cy/cz timing at which received data is written to buffer sclk0 input bit 0 bit 6 bit 7 bit 1 txd0 (inttx0 interrupt request) bit 0 timing at which transmit data is written to buffer (intrx0 interrupt request) bit 5 bit 1 bit 0 bit 6 bit 7 bit 1 rxd0 bit 0 bit 5 bit 1 when wbuf = 1 (without error) timing at which received data is written to buffer sclk0 input bit 0 bit 6 bit 7 bit 1 txd0 (inttx0 interrupt request) bit 0 timing at which transmit data is written to buffer (intrx0 interrupt request) bit 5 bit 1 bit 0 bit 6 bit 7 bit 1 rxd0 bit 0 bit 5 bit 1 perr (underrun error) when wbuf = 1 (if error occurs) (2) mode 1 (7-bit uart mode) setting the sm1 and sm0 bits of the serial ch annel mode register sc0mod to 01 places the device into 7-bit uart mode. in this mode, a parity bit can be used. parity can be enabled or disabled using the pe bit of the serial channel control register sc0cr. when pe = 1 (parity enabled), even or odd parity can be selected using sc0cr. the stop b it length can also be specified using scnmod2. tmp1942cy/cz-277
tmp1942 cy/cz example: to transmit data in the following fo rmat, set the control registers as shown below. * clock conditions system clock: high-speed (fc) high-speed clock gear: 1 (fc) prescaler clock: f periph/4 (f periph = f sys ) 7 6 5 4 3 2 1 0 pdcr ? ? ? ? ? ? ? 1 pdfc ? ? ? ? ? ? ? 1 set pd0 to txd0 pin. sc0mod x 0 ? x 0 1 0 1 select 7-bit uart mode. sc0cr x 1 1 x x x 0 0 select even parity. br0cr 0 0 1 0 1 0 1 0 set transfer rate to 2400 bps. imcclh ? ? 1 1 0 1 0 0 enable inttx0 interrupt and set its priority level to 4. sc0buf * * * * * * * * set transmit data. note: x = don?t care; ??? = no change (3) mode 2 (8-bit uart mode) setting the sm1 and sm0 bits of sc0mod to 10 pl aces the device into 8-bit uart mode. in this mode, a parity bit can be used. parity can be enabled or disabled using sc0cr. when pe = 1 (parity enabled), even or odd parity can be selected using sc0cr. example: to transmit data in the following fo rmat, set the control registers as shown below. * clock conditions system clock: high-speed (fc) high-speed clock gear: 1 (fc) prescaler clock: f periph/4 (f periph = f sys ) ? setting in the main routine 7 6 5 4 3 2 1 0 pdcr ? ? ? ? ? ? 0 ? set pd1 (rxd0) to input pin. sc0mod ? 0 0 x10 01 select 8-bit uart mode. sc0cr x 0 1 x x x 0 0 select odd parity. br0cr 0 0 0 1 0 1 0 1 set transfer rate to 9600 bps. imccll ? ? 1 101 00 enable intrx0 interrupt and set its priority level to 4. sc0mod ? ? 1 x ? ? ? ? enable reception. ? example of interrupt routine processing intclr x x 1 1 0 0 0 0 clear interrupt request. reg. sc0cr and 0x1c if reg. 0 then error processing check for errors. reg. sc0buf read received data. end of interrupt processing direction of transfer (transfer rate = 2400 bps at fc = 24.576 mhz) start bit 0 1 2 3 5 4 6 even parity stop direction of transfer (transfer rate = 9600 bps at fc = 24.576 mhz) start bit 0 1 2 3 5 4 6 odd parity stop 7 note: x = don?t care; ??? = no change tmpr1942cy/cz-278
tmp1942cy/cz (4) mode 3 (9-bit uart mode) setting sc0mod0 to 11 places the device into 9-bit uart mode. in this mode a parity bit cannot be used; hence, parity should be disabled by setting sc0cr to 0. during transmission the most significant bit (the 9th bit) is written to the tb8 bit of the serial channel mode register sc 0mod0. during reception the bit is st ored in the rb8 bit of the serial channel control register sc0cr. data is always wr itten to or read from the buffer register the most significant bit first and then the rest of the data from sc0buf. the stop bit length can be specified using scnmod2. wake-up function in 9-bit uart mode, slave controller wake-up can be enabled by setting sc0mod0 to 1. an intrx0 interrupt will only be generated if rb8 = 1. txd master slave 1 slave 2 slave 3 rxd txd rxd txd txd rxd rxd note: the slave controller?s txd pin must always be placed in open-drain output mode by setting the ode register accordingly. figure 3.11.41 serial link using the wake-up function tmp1942cy/cz-279
tmp1942 cy/cz tmpr1942cy/cz-280 1) the master and slave controllers are placed in 9-bit uart mode. 2) each slave controller is enabled for reception by setting sc0mod0 to 1. 3) the master controller transmits one frame of data including the 8-bit slave controller selection code. at this point the most significant bit (bit 8: tb8) is set to 1. 4) each slave controller receives the above frame. the slave controller whose selection code matches the transmitted selection code clears its wu bit to 0. 5) the master controller transmits data to th e selected slave controller (the one whose sc0mod0 bit has been cleared to 0). at this point the most significant bit (bit 8: tb8) is set to 0. 6) no interrupt (intrx0) is genera ted for the slave controllers wh ose wu bit remains 1 because the most significant bit of the received data (bit 8: rb8) = 0. these slave controllers ignore the received data. the slave controller whose wu bit ha s been cleared to 0 can transmit data to the master controller so as to notify the mast er controller that it has finished receiving. example settings: serial link with two slave controllers using the internal clock f sys/2 as the transfer clock protocol data ?0? start bit 0 1 2 3 5 4 6 stop 7 bit 8 txd master slave 1 slave 2 selection code 00000001 rxd txd rxd txd rxd selection code 00001010 slave controller selection code start bit 0 1 2 3 5 4 6 stop 7 8 ?1?
tmp1942cy/cz ? master controller settings main routine 7 6 5 4 3 2 1 0 pdcr ? ? ? ? ? ? 01 pdfc ? ? ? ? ? ? x1 set pd0 to txd0 and pd1 to rxd0. imccll ? ? 1 101 01 enable intrx0 and set interrupt level to 5. imcclh ? ? 1 101 00 enable inttx0 and set interrupt level to 4. sc0mod0 1 0 1 0 1 1 1 0 select 9-bit uart mode and set transfer clock to f sys/2 . sc0buf 0 0 0 0 0 0 0 1 set selection code for slave 1. interrupt routine (inttx0) intclr x x 1 1 0 0 0 1 clear interrupt request. sc0mod0 0 ? ? ? ? ? ? ? set tb8 to 0. sc0buf * * * * * * * * set transmit data. end of interrupt processing ? slave settings main routine 7 6 5 4 3 2 1 0 pdcr ? ? ? ? ? ? 01 pdfc ? ? ? ? ? ? x1 set pd0 to txd (open-drain output) and pd1 to rxd. ode x x ? ? ? ? ? 1 imccll ? ? 1 101 10 enable inttx0 and intrx0. imcclh ? ? 1 101 01 sc0mod0 0 0 1 1 1 1 1 0 select 9-bit uart mode and set transfer clock to f sys/2 and wu to 1. interrupt routine (intrx0) 7 6 5 4 3 2 1 0 intclr x x 1 1 0 0 0 0 clear interrupt request. reg. sc0buf if reg. = selection code then sc0mod0 ? ? ? 0 ? ? ? ? clear wu to 0. tmp1942cy/cz-281
tmp1942cy/cz tmp1942cy/cz-282 3.12 serial bus interface (sbi) the tmp1942 contains one serial bus interface (sbi) cha nnel. the serial bus interface has the following two operating modes: ? i 2 c bus mode (multi-master) ? clock-synchronous 8-bit sio mode in i 2 c bus mode, the serial bus interface can be connected to external devi ces via pf4 (sda) and pf5 (scl). in clock-synchronous 8-bit sio mode, it can be connected to external devices via pf3 (sck), pf4 (so) and pf5 (si). the following table shows the pin settings for each mode: ode pfcr pafc i 2 c bus mode 11 11x 110 clock-synchronous 8-bit sio mode xx 011 010 111 x: don?t care 3.12.1 configuration i 2 c bus clock synchroni- zation and control noise canceller shift register sbi0cr2/ sbi0sr sbi0dbr ints2 interrupt request t sbi control register 2/sbi status register i 2 c bus address register sbi data buffer register sbi control register 1 sbi baud rate registers 0 and 1 sda so si scl sck pf3 pf4 pf5 (sck) (so/sda) (si/scl) sio clock control divider transfer controller sbi0cr1 sbi0br0, 1 i2c0ar noise canceller i 2 c bus data control sio data control input/ output control
tmp1942cy/cz tmp1942cy/cz-283 3.12.2 control the following registers are used to control the serial bus interface and monitor its operating status: ? serial bus interface control register 1 (sbi0cr1) ? serial bus interface control register 2 (sbi0cr2) ? serial bus interface data buffer register (sbi0dbr) ? i 2 c bus address register (i2c0ar) ? serial bus interface stat us register (sbi0sr) ? serial bus interface status register 0 (sbi0br0) ? serial bus interface status register 1 (sbi0br1) the functions of the above registers vary according to the current operating mode of the serial bus interface. for details, refer to section 3.12.4, ?control in i 2 c bus mode?, and section 3.12.7, ?control in clock-synchronous 8-bit sio mode?. 3.12.3 i 2 c bus mode data formats figure 3.12.1 shows the serial bus interface data formats used in i 2 c bus mode. s: start condition r/w: direction bit ack: acknowledge bit p: stop condition figure 3.12.1 i 2 c bus mode data formats r / w r / w s (a) addressing format (b) addressing format (with restart) (c) free data format (format used to transfe r data from master device to slave device) slave address data p s s sp p 8 bits 1 to 8 bits 1 one entry of arbitrary length 1 to 8 bits a c k slave address data data one entry one entry a c k a c k 8 bits 1 to 8 bits 8 bits 1 to 8 bits 11 11 1 1 8 bits 1 to 8 bits 1 to 8 bits data data data data a c k 11 1 slave address of arbitrary length one entry of arbitrary length of arbitrary length r / w a c k a c k a c k a c k a c k a c k
tmp1942cy/cz tmp1942cy/cz-284 3.12.4 i 2 c bus mode control registers when the serial bus interface is operated in i 2 c bus mode, the following regist ers are used to control the interface and to monitor its operating status: serial bus interface control register 1 7 6 5 4 3 2 1 0 sbi0cr1 bit symbol bc2 bc1 bc0 ack ? sck2 sck1 sck0/ swrmon (0xffff_f240) read/write w r/w w r/w after reset 0 0 0 0 0 0 1 function selects number of bits to be transferred (note 1) ack clock 0: do not generate 1: generate selects internal scl output clock frequency (note 2) and monitors reset state selects internal scl output clock frequency (for write) 000 001 010 011 100 101 110 111 n=4 n=5 n=6 n=7 n=8 n=9 n=10 400 khz 222 khz 118 khz 60.6 khz 30.8 khz 15.5 khz 7.78 khz reserved system clock:: fc(=32 mhz) clock gear: : fc/1 t0 = fperiph/4 (= 8 mhz) frequency = 4 + 2n t0 [ hz ] software reset state monitor (for read) 0 software reset in progress 1 software reset not in progress selects number of bits to be transferred = 0 = 1 number of clock cycles data length number of clock cycles data length 000 001 010 011 100 101 110 111 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 9 2 3 4 5 6 7 8 8 1 2 3 4 5 6 7 note 1: clear sbi0cr1 to 000 before swit ching the device to clock-synchronous 8-bit sio mode. note 2: for details of the scl line clock frequency , refer to section 3.12.5 (3), ?serial clock?. figure 3.12.2 i 2 c bus mode registers
tmp1942cy/cz tmp1942cy/cz-285 serial bus interface control register 2 7 6 5 4 3 2 1 0 sbi0cr2 bit symbol mst trx bb pin sbim1 sbim0 swrst1 swrst0 (0xffff_f243) read/write w w (note 1) w (note 1) after reset 0 0 0 1 0 0 0 0 function selects master/ slave 0: slave 1: master selects transmit/ receive 0: receive 1: transmit start/stop generation 0: generate stop state 1: generate start state cancels intsbi interrupt request 0: ? 1: cancel interrupt request selects serial bus interface operating mode (note 2) 00: port mode 01: sio mode 10: i 2 c bus mode 11: (reserved) generates software reset a reset can be generated by writing 10 and then 01 to these bits. selects serial bus interface operating mode (note 2) 00 port mode (serial bus interface output disabled) 01 clock-synchronous 8-bit sio mode 10 i 2 c bus mode 11 (reserved) note 1: when read, this register functions as the sbi0sr register. note 2: check to see that the bus is free before swit ching the device to port mode. also, check that input signals on the ports are high before switching from port mode to i 2 c bus mode or clock-synchronous 8-bit sio mode. figure 3.12.3 i 2 c bus mode registers table 3.12.1 output clock ( t0) resolutions @fc=32 mhz prescaler output clock resolution peripheral clock selection clock gear value selected prescaler clock t0 00 (fperiph/4) fc/2 2 (0.125 s) 01 (fperiph/2) ? 00 (fc) 10 (fperiph) ? 00 (fperiph/4) fc/2 3 (0.25 s) 01 (fperiph/2) ? 01 (fc/2) 10 (fperiph) ? 00 (fperiph/4) fc/2 4 (0.5 s) 01 (fperiph/2) ? 10 (fc/4) 10 (fperiph) ? 00 (fperiph/4) fc/2 5 (1.0 s) 01 (fperiph/2) ? 0 (fgear) 11 (fc/8) 10 (fperiph) ? 00 (fperiph/4) fc/2 2 (0.25 s) 01 (fperiph/2) ? 00 (fc) 10 (fperiph) ? 00 (fperiph/4) ? 01 (fperiph/2) ? 01 (fc/2) 10 (fperiph) ? 00 (fperiph/4) ? 01 (fperiph/2) ? 10 (fc/4) 10 (fperiph) ? 00 (fperiph/4) ? 01 (fperiph/2) ? 1 (fc) 11 (fc/8) 10 (fperiph) ? note: the ? character means ?don?t use?.
tmp1942cy/cz tmp1942cy/cz-286 serial bus interface status register 7 6 5 4 3 2 1 0 sbi0cr bit symbol mst trx bb pin al aas ad0 lrb (0xffff_f243) read/write r after reset 0 0 0 1 0 0 0 0 function master/ slave selection 0: slave 1: master transmit/r eceive selection 0: receive 1: transmit i2c bus status 0: bus free 1: bus busy ints2 interrupt request status 0: interrupt request generated 1: interrupt request cancelled arbitration lost detection 0: ? 1: detected slave address match detection 0: ? 1: detected general call detection 0: ? 1: detected last received bit 0: 0 1: 1 last received bit 0 last bit received was 0 1 last bit received was 1 slave address match detection 0 ? 1 matching slave address or general call has been detected arbitration lost detection 0 ? 1 arbitration lost has been detected note: when written, this register functions as the sbi0cr2 register. figure 3.12.4 i 2 c bus mode registers
tmp1942cy/cz tmp1942cy/cz-287 serial bus interface baud rate register 0 7 6 5 4 3 2 1 0 sbi0br0 bit symbol ? i2sbi0 ? ? ? ? ? ? (0xffff_f244) read/write ? r/w ? ? ? ? ? w after reset ? 0 ? ? ? ? ? ? function idle 0: idle 1: operate m u s t always be set to 0. operation in idle mode 0 idle 1 operate serial bus interface baud rate register 1 7 6 5 4 3 2 1 0 sbi0br1 bit symbol p4en ? ? ? ? ? ? ? (0xffff_f245) read/write r/w ? ? ? ? ? ? w after reset 0 ? ? ? ? ? ? ? function internal clock 0: stopped 1: operate operation in idle mode 0 idle 1 operate serial bus interface baud rate register 7 6 5 4 3 2 1 0 sbi0dbr bit symbol db7 db6 db5 db4 db3 db2 db1 db0 (0xffff_f241) read/write r (receive)/w (transmit) after reset undefined note: when writing transmit data, make sure t hat the data is msb-justified (bit 7 is the msb). i 2 c bus address register 7 6 5 4 3 2 1 0 sbi0br1 bit symbol sa6 sa5 sa4 sa3 sa2 sa1 sa0 als (0xffff_f242) read/write w after reset 0 0 0 0 0 0 0 0 function specifies slave address when devic e is operating as slave device specifies address recognition mode operation in idle mode 0 idle 1 operate figure 3.12.5 i 2 c bus mode registers
tmp1942cy/cz tmp1942cy/cz-288 3.12.5 control in i 2 c bus mode (1) specifying acknowledgment mode setting sbi0cr1 to 1 causes the serial bus interface to operate in acknowledgment mode. when operating as the master device, the device allows one extra clock cycle for an acknowledge signal. in transmitter mode, the device releases th e sda pin during this clock cycle so that it can receive an acknowledge signal from the receiver . in receiver mode, the device pulls the sda pin low during this clock cycle, thus generating an acknowledge signal. setting sbi0cr1 to 0 causes the serial bus interface to operate in non-acknowledgment mode, in which case the device will not generate an extra clock cycle for an acknowledge signal. (2) selecting the number of bits to be transferred sbi0cr1 can be used to specify the number of bits in the next data item to be transmitted or received. since the bc2:bc0 bits are cleared to 000 as a st art condition, the slave address and direction bit are always transferred as eight bits. in all other cases, the bc2:bc0 bits hold the value which has been set. (3) serial clock 1) clock source the sbi0cr1 bits are used to se lect the maximum transf er frequency of the serial clock which is output on the scl pin in master mode. figure 3.12.6 clock source t high t low 1/fscl t low = 2 n / t0 t high = 2 n / t0 + 4/ t0 fscl = 1/(t low + t high ) = 4 + 2n t0 sbi0cr1 n 000 001 010 011 100 101 110 4 5 6 7 8 9 10
tmp1942cy/cz tmp1942cy/cz-289 2) clock synchronization in i 2 c bus mode, a master device which first pulls the clock line low will disable the clocks of other master devices which are outputting a high clock pulse, thus implementing wired-and bus configuration. th erefore, any master which is outputting a high clock pulse must detect the situation an d take appropriate action. since the serial bus interface has a clock sy nchronization function, transfers are always performed correctly even when multiple ma ster devices are present on the bus. the clock synchronization procedure is described below using an example in which there are two masters on the bus. figure 3.12.7 clock synchronization example master a pulls the internal scl output low at point 'a' so that the bus scl line goes low. master b detects this and resets its high-level period count before pulling its internal scl output low. master a finishes low-level period counting at point 'b', releasing its internal scl output back high. however, since master b is still holding the scl line low, master a does not start high-level period counting. at point ?c?, when master b has released its internal scl output back high and the bus scl line goes high, master a detects these conditions and starts high-level period counting. thus, the bus clock frequency is determined by the master connected to the bus which has the shortest high-level period and the master connected to the bus which has the longest low-level period. (4) setting the slave address and selecting address recognition mode to operate the device as a slave device, set th e slave address in i2c0 ar and . setting als to 0 selects address recognition mode. (5) specifying a master or slave setting sbi0cr2 to 1 causes the device to operate as a master device. setting sbi0cr2 to 0 causes the device to op erate as a slave device. if a stop condition or arbitration lost is detected on the bus, sbi0cr2 is automatically cleared to 0 by hardware. internal scl output (master a ) internal scl output (master b) scl line reset high-level period count wait for high-level period counting start high-level period counting abc
tmp1942cy/cz tmp1942cy/cz-290 (6) selecting a transmitter or receiver setting sbi0cr2 to 1 causes the device to operate as a transmitter. setting sbi0cr2 to 0 causes the device to operate as a receiver. in slave mode, ? when transferring data in addressing format ? when the received slave address is th e same as the value set in i2c0ar ? when a general call (all 8 bits of data after a start condition are 0) is received trx is set to 1 by hardware when the direction bit ( w/r ) sent from the master device is 1 or set to 0 when the direction bit is 0. in master mode, when acknowledgement is returned from a slave device, trx changes to 0 by hardware if the transmitted direction bit is 1 or cha nges to 1 if the transmitted direction bit is 0. when no acknowledgement is returned, trx remains unchanged. if a stop condition or arbitration lost is detected on the bus, sbi0cr2 is automatically cleared to 0 by hardware. (7) generating a start/stop condition when sbi0sr = 0, writing 1s to sbi0cr2 causes a start condition and 8-bit data to appear on the bus. ensure that sbi0cr1 has been set to 1 beforehand. figure 3.12.8 generating a star t condition and slave address when bb = 1, writing 1s to sbi0cr2 and a 0 to sbi0cr2 initiates a stop condition output sequence on the bus. do not change the contents of sbi0cr2 until a stop condition has been generated on the bus. figure 3.12.9 generating a stop condition the bus status can be determined by reading sbi0sr. sbi0sr is set to 1 (bus busy state) upon the detection of a start condition on the bu s or reset to 0 (bus free state) upon the detection of a stop condition. scl line start condition a6 slave address and direction bit a cknowledge signal 1 sda line 234567 8 9 a5 a4 a3 a2 a1 a0 r/w stop condition scl line sda line
tmp1942cy/cz tmp1942cy/cz-291 (8) requesting interrupt service and canceling requests when a serial bus interface interrupt request (ints2) occurs, sbi0cr2 is reset to 0. the scl line is held low while sbi0cr2 = 0. pin is reset to 0 when the device has finished tran smitting or receiving one word of data, and set to 1 when data is written to or read from sbi0dbr. there is a delay of tlow between pin being set to 1 and the scl line being released. in address recognition mode (i.e. when i2c0cr = 0), pin is reset to 0 when the slave address received matches the value set in i2c0ar or when a general call is received (i.e. when the eight data bits after the start condition are all 0). writing a 1 to sbi0cr2 in the program sets it to 1; however, writing a 0 to pin does not clear it to 0. (9) serial bus interface operating mode the sbi0cr2 b its are used to set the operating mode of the serial bus interface. to use the serial bus interface in i 2 c bus mode, set sbi0cr2 to 10. ensure that the bus is free before switching from this mode to port mode. (10) monitoring detection of arbitration lost since multi-master operation is possible in i 2 c bus mode (i.e. two or more masters may exist on the bus simultaneously), a procedure for arbitrating among masters contending for bus control is needed in order to guarantee the in tegrity of data being transferred. any attempt to generate a start condition in the bus busy state will result in ?arbitration lost?; data is not output on the scl or sda line. the data on the sda line is used for bus arbitration in i 2 c bus mode. the arbitration procedure is described below using an example in which two masters are residing on the bus simultaneously. masters a and b output th e same data until the bit at point ?a?, at which point master a outputs a low signal and master b a high signal. since the sda line of the bus has wired-and configuration, it is pu lled low by master a. when the scl line goes high at point ?b?, the slave device latches the sda line data (i.e. the data output by master a). the data output by master b at this time has no effect and is ignore d. this condition of master b is referred to as ?arbitration lost?. master b releases the sda pin so th at it will not affect data output by other masters. if more than one master transmits the same fi rst data word, the arbitration procedure will be continued on the next and subsequent words. figure 3.12.10 arbitration lost a rbitration is lost and the internal sda output is driven high scl line internal sda output (master a) internal sda output (master b) sda line ab
tmp1942cy/cz tmp1942cy/cz-292 the internal sda output level for each master is compared with the level of the bus sda line at the rising edge of the scl clock. if the levels do no t match, it is assumed that arbitration is lost and sbi0sr will be set to 1. at this point the sbi0sr bits are reset to 00, thus placing the master into slave receiver mode. sbi0sr is cleared to 0 by writin g data to or reading data from sbi0dbr, or by writing data to sbi0cr2. figure 3.12.11 example for master b (d7a = d7b, d6a = d6b) (11) monitoring detection of a slave address match if the device is operating as a slave device in address recognition mode (i2c0ar = 0) and receives a general call or a slave address of the same value as that set in i2c0ar, sbi0sr will be set to 1. if i2c0ar = 1, sbi0sr will be set to 1 upon the reception of the first word. the aas flag is cleared to 0 by writin g data to or reading data from sbi0dbr. (12) monitoring detection of a general call sbi0sr is set to 1 when a general call is r eceived (i.e. when the eight data bits after the start condition are all 0) in slave mode, and is reset to 0 when a start or stop condition is detected on the bus. (13) monitoring the last bit received sbi0sr holds the value of the sda line which is latched at the rising edge of the scl clock. in acknowledgment mode, the value read from sbi0sr immediately after an ints2 interrupt request has been generated is equivalent to the value of the ack signal. clock output stops here. 1 internal scl output internal sda output a ccess to sbi0dbr or sbi0cr2 internal scl out p ut internal sda output internal sda out p ut internal scl out p ut master a master b 23456789 1 2 34 d7a d6b d5a d4a d3a d2a d1a d0a d7a? d6a? d5a? d4a? 1 234 d7b d6a
tmp1942cy/cz tmp1942cy/cz-293 (14) software reset if the serial bus interface circuit locks due to noise from external sources, it can be initialized using the software reset function. writing 10 and then 01 to sbi0cr2 causes a reset signal pulse to be applied to the serial bus interface circuit, initiali zing it. all control regist ers and status flags are initialized to their reset values. sbi0cr2 are automatically cleared to 00 upon the initialization of the serial bus interface. note: a software reset also resets the selection of the operating mode, causing a transition from i 2 c bus mode to clock-sync hronous 8-bit sio mode. (15) serial bus interface data buffer register (sbi0dbr) reading received data fr om and writing transmit data to th e serial bus interface circuit are accomplished by reading from and writing to sbi0d br. in addition, in master mode the slave address and the direction bit are set in this regi ster, after which a start condition is generated. (16) i 2 c bus address register (i2c0ar) when the device is operating as a slave device, the i2c0ar bits are used to set the slave address. in addition, when i2c0ar = 0, the device recognizes the slave address output by the master device, and data is sent in addr essing format. when i2c0ar = 1, the device will not recognize the slave address output by the master device, and data will be sent in free format. (17) baud rate register (sbi0br1) before the i 2 c bus can be used, the p4en bit of the baud rate circuit control register (sbi0br1) must be set to 1. (18) idle2 setting register (sbi0br0) the sbi0br0 bit enables or disables device operati on after the device has entered idle mode. this bit must be set before the instruction to enter standby mode is executed.
tmp1942cy/cz tmp1942cy/cz-294 3.12.6 data transfer procedure in i 2 c bus mode (1) initializing the device first, set sbi0br1 and sbi0cr1. set sbi0br1 to 1 and clear bits 7-5 and 3 of sbi0cr1 to 0. next, set the slave address in i2c0ar and set i2c0ar to 0 for addressing format. then, to initialize the device to slave receive r mode, set sbi0cr2 to 000, sbi0cr2 to 1, sbi0cr2 to 10 and clear bits 1 and 0 of sbi0cr2 to 00. 7 6 5 4 3 2 1 0 sbi0br1 1 0 0 0 0 0 0 0 operate internal baud rate generator. sbi0cr1 0 0 0 x 0 x x x set ack and scl clocks. i2c0ar x x x x x x x x set slave address and address recognition mode. sbi0cr2 0 0 0 1 1 0 0 0 select slave receiver mode. (note) x: don?t care (2) generating a start condition and slave address 1) in master mode follow the procedure described below to generate a start condition and slave address in master mode: first, check that the bus is free (sbi0sr< bb> = 0). next, place the serial bus into acknowledgment mode by setting sbi0cr1 to 1. also, write the slave address and direction bit to sbi0dbr. while sbi0sr = 0, set sbi0cr2 to 1111 to generate a start condition on the bus. then output nine clock pulses on the scl pin. for the first eight clock pulses, output the slave address and direction bit which have been set in sbi0dbr. release the sda line on the ninth clock pulse to receive an acknowledge signal from the slave device. an ints2 interrupt request is generated at the falling edge of the ninth clock pulse, resetting sbi0cr2 to 0. in master mode, the scl line is held low while pin = 0. in addition, only when an acknowledge signal is returned from the slave device, the generation of an ints2 interrupt request causes sbi0cr2 to change state according to the transmitted direction bit. settings in the main routine 7 6 5 4 3 2 1 0 reg. sbi0sr reg. reg. e 0x20 if reg. 0x00 check that bus is free. then sbi0cr1 x x x 1 0 x x x select acknowledgement mode. sbi0dr1 x x x x x x x x set slave address and direction for target slave. sbi0cr2 1 1 1 1 1 0 0 0 generate start condition. example of ints2 interrupt routine processing intclr 0x34 clear interrupt request. processing end of interrupt processing
tmp1942cy/cz tmp1942cy/cz-295 2) in slave mode in slave mode a start condition and slave address are received. the slave address and the direction bit are r eceived from the master device with the first eight clock pulses on the scl line after the star t condition. the start condition is also received from the master device. when a general call or an address identical to the slave address which has been set in i2c0ar is received, the sda line is pulled low on the ninth clock pulse to output an acknowledge signal. an ints2 interrupt request is generated at the falling edge of the ninth clock pulse, resetting sbi0cr2 to 0. in slave mode, the scl line is held low while pin = 0. note: dma transfer can be used only when the following conditions are satisfied: - a single master corresponds to a single slave. - continuous transmission or reception is possible. figure 3.12.12 generating a start condition and slave address (3) transferring one word of data during the ints2 interrup t processing which takes place after th e device has finished transferring one word of data, sbi0sr is tested to dete rmine whether the device is placed in master mode or slave mode. 1) in master mode (when sbi0sr = 1) sbi0sr is tested to determine whether the device is a transmitter or a receiver. in transmitter mode (when sbi0sr = 1) sbi0sr is tested. if sbi0sr = 1, the receiver is not requesting data; therefore, a sequence for generating a stop cond ition (described later) should be performed to terminate the data transfer. if sbi0sr = 0, the receiver is requesting the next data item. if the next data item to be transferred is 8 bits long, wr ite the transfer data to sbi0d br. if it is not 8 bits long, set sbi0cr1 and sbi0cr1 before writing the transfer data to sbi0dbr. when data is written to the data buffer register, sbi0cr2 is set to 1, the serial clock for transferring the next word of data is generated from the input on the scl pin, and one word of data is output on the sda pin. when the device has finished transferring data, an ints2 interrupt request is generated, sbi0cr2 is reset to 0 and the scl pin is pulled low. to transfer more than one word , repeat the above procedure starting from the test of sbi0sr. scl start condition a6 slave address + direction bit a ck from slave 1 sda 2 345678 9 a5 a4 a3 a2 a1 a0 wr/ ints2 interrupt request ack master output slave output
tmp1942cy/cz tmp1942cy/cz-296 ints2 interrupt if mst = 0 then go to slave mode processing if trx = 0 then go to receiver mode processing if lrb = 0 then go to processing for generating stop condition sbi0cr1 x x x x 0 x x x set number of bits to be transferred and ack. sbi0dbr x x x x x x x x write transfer data. end of interrupt processing note: x: don't care figure 3.12.13 example in which sbi0cr1 = 000 and sbi0cr1 = 1 (transmitter mode) in receiver mode (when sbi0sr = 0) if the next data item to be transferred is 8 bits long, write the transfer data to sbi0dbr. if it is not 8 bits long, set sbi0cr1 and sbi0cr1 and then read the received data from sbi0dbr in order to release the scl line. (the data read out immediately after the transmission of the slave address is undefined.) when data is read from the data buffer register, sbi0cr2 is set to 1. the serial clock for transferring the next word of data is output on the scl pin. the sda pin is pulled low at the final bit when the acknowledge signal goes low. an ints2 interrupt request is now generated, sbi0cr2 is reset to 0 and the scl pin is pulled low. each time received data is read from sbi0dbr, a clock pulse for one-word data transfer and an acknowledge signal are output. figure 3.12.14 example in which sbi0cr1 = 000 and sbi0cr1 = 1 (receiver mode) scl pin write to sbi0dbr d7 a ck signal from receiver 1 sda pin 2 345678 9 d6 d5 d4 d3 d2 d1 ints2 interrupt request ack master output slave output d0 scl d7 a ck signal to transmitter 1 sda 2 345678 9 d6 d5 d4 d3 d2 d1 ints2 interrupt request ack master output slave output d0 read received data next d7
tmp1942cy/cz tmp1942cy/cz-297 to instruct the transmitter to terminate data transmission, set sbi0cr1 to 0 before reading the data which is one word before the last data to be r eceived. this disables generation of an acknowledge clock pulse for the last data. as part of the processing after the generation of an end-of-transfer interrupt request, set sbi0cr1 to 001 and read out data, at which time a clock pulse for one-bit data transfer is generated. since the master at this time is a receiver, it will hold the bus sda line high. the transmitter receive s this high-level signal as an ack signal, so that the receiver can request the transmitter to terminate transmission. as part of the processing after the interrupt request generated upon the completion of receiving this one bit, generate a stop condition to terminate data transfer. figure 3.12.15 terminating data tr ansmission in master receiver mode example: when receiving data n times ints2 interrupt (after transmitting data) 7 6 5 4 3 2 1 0 sbi0cr1 x x x x 0 x x x set number of bits received and ack. reg. sbi0cbr read dummy data. end of interrupt ints2 interrupt (first to (n-2)th data reception) 7 6 5 4 3 2 1 0 reg. sbi0dbr read first to (n-2)th received data. end of interrupt ints2 interrupt ((n-1) th data reception) 7 6 5 4 3 2 1 0 sbi0cr1 x x x 0 0 x x x disable generation of cl ock for acknowledge signal. reg. sbi0dbr read (n-1)th received data. end of interrupt ints2 interrupt (nth data reception) 7 6 5 4 3 2 1 0 sbi0cr1 0 0 1 0 0 x x x generate clock for 1-bit transfer. reg. sbi0dbr read nth received data. end of interrupt ints2 interrupt (after receiving data) processing for generating stop condi tion terminate data transfer. end of interrupt note: x: don't care scl d7 a ck signal (high) to transmitter 1 sda 2 345678 1 d6 d5 d4 d3 d2 d1 ints2 interrupt request master output slave output d0 a fter clearing sbi0cr1 to 0, read received data. 9 after setting sbi0cr1 to 001, read received data.
tmp1942cy/cz tmp1942cy/cz-298 2) in slave mode (sbi0sr = 0) in slave mode, an ints2 interrupt request is generated when a slave address or general call sent by the master is received, or when the da ta transfer is completed after a general call is received or the received slave address is found to match the device's address. also, if the arbitration-lost condition is detected in master mode, the device will operate in slave mode, in which case an ints2 interrupt request will be generated when the device has finished transferring the word in which the arbitratio n-lost condition was detected. when an ints2 interrupt request occurs, sbi0cr2 is set to 0 and the scl pin is pulled low. the scl pin is released tlow after data is written to or read from sbi0dbr, or tlow after sbi0cr2 is set to 1. in slave mode, perform the processing which normally needs to be performed in slave mode or any processing which needs to be performed after the device has entered slave mode upon detecting the arbitration-lost condition. in each case, test sbi0sr to determine the necessary processing. table 3.12.1 shows the various slave mode st atuses and the necessary processing for each. example: when the slave address is matched and the direction bit is 1 in slave receiver mode ints2 interrupt if trx = 0 then go to other processing if al = 1 then go to other processing if aas = 0 then go to other processing sbi0cr1 x x x 1 0 x x x set number of bits to be transmitted. sbi0dbr x x x x 0 x x x set transmit data. note: x: don't care
tmp1942cy/cz tmp1942cy/cz-299 table 3.12.2 processing in slave mode status processing 1 1 0 the arbitration-lost condition was detected while the slave address was being sent and the device received a slave address sent by another master for which the direction bit was 1. 1 0 in slave receiver mode, the device received a slave address sent by another master for which the direction bit was 1. set sbi0cr1 to the number of bits in one word and write the data to be transmitted to sbi0dbr. 1 0 0 0 the device has finished sending one data word in slave transmitter mode. test sbi0sr. if it is set to 1, indicating that the receiver is not requesting the next data item, set sbi0cr2 to 1 and reset to 0 to release the bus. if sbi0sr = 0, indicating that the receiver is requesting the next data item, set sbi0cr1 to the number of bits in one word and write the data to be transmitted to sbi0dbr. 1 1/0 the arbitration-lost condition was detected while the slave address was being sent and the device received either a slave address sent by another master for which the direction bit was 0 or a general call. 1 0 0 the arbitration-lost condition was detected while the slave address or data was being sent and the device finished sending the word. 1 1/0 in slave receiver mode, the device received either a slave address sent by another master for which the direction bit was 0 or a general call. read sbi0dbr to set sbi0cr2 to 1 (a dummy read), or set it by writing a 1 to it. 0 0 0 1/0 in slave receiver mode, the device has finished receiving one word of data. set sbi0cr1 to the number of bits in one word and read the received data from sbi0dbr.
tmp1942cy/cz tmp1942cy/cz-300 (4) generating a stop condition if sbi0sr = 1, set sbi0cr2 to 111 and reset sbi0cr2 to 0. the device starts a sequence for outputting a stop cond ition to the bus. do not rewrite the contents of sbi0cr2 until the stop condition appears on the bus. note, however, that if the bus scl line has been pulled low by some other device, the device will wait until the scl line is released high again; when scl is high again, the device will drive the sda pin high, thereby generating a stop condition. 7 6 5 4 3 2 1 0 sbi0cr2 1 1 0 1 1 0 0 0 generate stop condition. figure 3.12.16 generating a stop condition scl pin sda pin (read) stop condition ?1? ?1? ?0? ?1?
tmp1942cy/cz tmp1942cy/cz-301 (5) restart procedure restart is used by a master device to change the di rection of transfer with respect to a slave device without terminating data transfer. the following s hows how to trigger a restart when the device is operating in master mode. first, reset sbi0cr2 to 000 and set sbi0cr2 to 1 to release the bus. since at this time the sda pin is held high and the scl pin is released, no stop condition is generated on the bus, with the result that the bus appears to other masters to be in busy state still. then, test sbi0sr and wait until it becomes 0, confirming that the scl pin has been released. next, test sbi0sr and wait until it becomes 1, confirming that no other device is pulling the bus scl line low. after using the above procedures to confirm that the bus is free, generate a start condition by following the procedure described earlier in (2). note, however, that in order to yi eld the necessary restart set-up ti me, a wait time of at least 4.7 s must be generated by software between the bus free state being confirmed and a start condition being generated. 7 6 5 4 3 2 1 0 sbi0cr2 0 0 0 1 1 0 0 0 release bus. if sbi0sr 0 check that scl pin is released. then if sbi0sr 1 check that no other device is pulling scl line low. then 4.7 s wait sbi0cr1 x x x 1 0 x x x select acknowledgement mode. sbi0dbr x x x x x x x x set slave address and direction for target slave. sbi0cr2 1 1 1 1 1 0 0 0 generate start condition. note: x: don't care figure 3.12.17 restart generation timing note : please do not carry out the light of =?0? in the state of =?0? (it cannot re-start). ?0? ?0? ?0? ?1? ?1? ?1? ?1? ?1? scl (bus) scl pin sda pin 4.7 s (min.) start condition 9
tmp1942cy/cz tmp1942cy/cz-302 3.12.7 control in clock-synchronous 8-bit sio mode the following section describes the registers which are used to contro l the serial bus interface and to monitor its operating status when it is used in clock-synchronous 8-bit sio mode serial bus interface baud rate register 0 7 6 5 4 3 2 1 0 sbi0cr1 bit symbol sios sioinh siom1 siom0 ? sck2 sck1 sck0 (0xffff_f240) read/write w ? w r/w after reset 0 0 0 0 ? 0 0 1 function indicate transfer start/stop 0: stop 1: start continue/ abort transfer 0: continue transfer 1: abort transfer transfer mode selection 00: transmit mode 01: (reserved) 10: transmit/receive mode 11: receive mode selects serial clock frequency and monitors reset state selects serial clock frequency (for write) 1.25 khz 625 khz 312.5 khz 156.3 khz 78.13 khz 39.06 khz 19.53 khz system clock:: fc(=40 mhz) clock gear: : fc/1 t0 = fperiph/4 (= 10 mhz) frequency = 2n t0 [ hz ] 000 001 010 011 100 101 110 111 n = 3 n = 4 n = 5 n = 6 n = 7 n = 8 n = 9 ? external clock note: set sbi0cr1 to 0 and sbi0cr1 to 1 before setting the transfer mode and the serial clock frequency. serial bus interface data buffer register 7 6 5 4 3 2 1 0 sbi0dbr bit symbol db7 db6 db5 db4 db3 db2 db1 db0 (0xffff_f241) read/write r (receive)/w (transmit) after reset undefined figure 3.12.18 sio mode registers
tmp1942cy/cz tmp1942cy/cz-303 serial bus interface control register 2 7 6 5 4 3 2 1 0 sbi0cr2 bit symbol ? ? ? ? sbim1 sbim0 ? ? (0xffff_f243) read/write ? ? ? ? w ? ? after reset ? ? ? ? 0 0 ? ? function selects serial bus interface operating mode 00: port mode 01: clock-synchronous 8-bit sio mode 10: i 2 c bus mode 11: (reserved) selects serial bus interface operating mode 7 6 5 4 3 2 1 0 sbi0sr bit symbol ? ? ? ? siof sef ? ? (0xffff_f243) read/write ? ? ? ? r ? ? after reset ? ? ? ? 0 0 ? ? function serial transfer operation status 0: transfer terminated 1: transfer in progress shift operation status 0: shift operation terminated 1: shift operation in progress serial bus interface baud rate register 0 7 6 5 4 3 2 1 0 sbi0br0 bit symbol ? i2sbi0 ? ? ? ? ? ? (0xffff_f244) read/write ? r/w ? ? ? ? ? w after reset ? 0 ? ? ? ? ? ? function idle 0: idle 1: operate m u s t always be set to 0. serial bus interface baud rate register 1 7 6 5 4 3 2 1 0 sbi0br1 bit symbol p4en ? ? ? ? ? ? ? (0xffff_f245) read/write r/w ? ? ? ? ? ? ? after reset 0 ? ? ? ? ? ? ? function internal clock 0: stopped 1: operate figure 3.12.19 sio mode registers
tmp1942cy/cz tmp1942cy/cz-304 (1) serial clock 1) clock source clock sources can be selected using sbi0cr1 as described below. internal clock in internal clock mode, one of seven clock so urce frequencies can be selected. the serial clock is output to external devices on the sck pin. note that when a transfer starts, the sck pin is driven high. the device has an automatic wait function which works as follows: if an operation to write data (during transmission) or read data (during reception) in a program cannot keep up with the serial clock rate, the device will automatically stop the serial clock and suspend the next shift operation until reading or writing has been completed. figure 3.12.20 automatic wait function external clock (sbi0cr1 = 111) a clock signal from an external source input via the sck pin can be used as the serial clock. to ensure that shift operations will be performed without fail, the high-level and the low-level durations of the serial clock must satisfy the pulse width conditions given below. figure 3.12.21 maximum transfer fr equency for external clock input sck pin output so pin output write transmit data 3 1 7 2 8 1 2 6 7 8 1 2 3 c 0 a b c automatic wait a 0 a 1 a 2 a 5 a 6 a 7 b 0 b 5 b 6 b 7 c 1 c 2 b 1 b 4 t sckh t sckl , t sckh > 8/fsys sck pin t sckl
tmp1942cy/cz tmp1942cy/cz-305 2) edges used for shifting during transmission data is shifted at the lead ing edge; during reception data is shifted at the trailing edge. leading-edge shift data is shifted at the leading edge of the serial clock (the falling edge of the sck pin input/output). trailing-edge shift data is shifted at the trailing edge of the serial clock (the rising edge of the sck pin input/output). figure 3.12.22 edges used for shifting bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 76543210 * 7654321 ** 765432 *** 76543 **** 7654 *****765 ******76 ******7 so pin bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 6543210 * 543210 ** 0 ******* 10****** 210 ***** 3210 **** 43210 *** ******** 76543210 sck pin shift register sck pin so pin shift register (a) leading-edge shift (b) trailing-edge shift note: * = don't care
tmp1942cy/cz tmp1942cy/cz-306 (2) transfer mode sbi0cr1 is used to select the mode of transfer among transmit mode, receive mode and transmit/receive mode. 1) 8-bit transmit mode after selecting transmit mode in the control register, write transmit data to sbi0dbr. transmission is initiated by setting sbi0cr1 to 1 after writing transmit data to the data buffer register. the transmit data is transf erred from sbi0dbr to the shift register, from which the data is shifted out to the so pin synchr onously with the serial clock, starting with the least significant bit (lsb). once the transmit da ta has been transferred from sbi0dbr to the shift register, sbi0dbr becomes empty and generates an intsbi (buffer empty) interrupt request to request the next transmit data. if an internal clock is being used, unless the next data item has been set in the data buffer register after the transmission of all 8 bits of data, the device will automatically stop the serial clock and suspend processing. the automatic wait is released when the next transmit data is written into the data buffer register. if an external clock is being used, data must be written into sbi0dbr before the next data item can be shifted. the transfer rate thus de pends on the maximum delay between an interrupt request being generated and data being written in to sbi0dbr by an interrupt service routine. when transmission is started, after the sb i0sr goes high, the so pin outputs the final bit of the last transferred data until the falling edge of sck. to terminate transmission write a 0 to sbi0cr1 or a 1 to sbi0cr1 in the interrupt service routine for the ints2 interr upt. once sbi0cr1 has been cleared, transmission will be terminated when all the data has been output. check sbi0sr in the program to determine whether transmission has been terminated. sbi0sr is reset to 0 upon the termination of transmission. if sbi0cr1 has been set to 1, transmission will be aborted immediatel y and sbi0sr cleared to 0. furthermore, if an external clock is being used, sbi0cr1 must be cleared to 0 before the device can start shifting out the next transmit data. unless sbi0cr1 has been cleared to 0 before the device shifts out the data, dummy data will be transmitted and transmit operation ends. 7 6 5 4 3 2 1 0 sbi0cr1 0 1 0 0 0 x x x select transmit mode. sbi0dbr x x x x x x x x write transmit data. sbi0cr1 1 0 0 0 0 x x x start transmission. ints2 interrupt sbi0dbr x x x x x x x x write transmit data.
tmp1942cy/cz tmp1942cy/cz-307 figure 3.12.23 transmit mode example: sample program (mips16) that instructs termination of sio transmission (with external clock) addiu r3, r0, 0x04 stest1 : lb r2, (sbi0sr) ; if sbi0sr = 1 then loop and r2, r3 bnez r2, stest1 addiu r3, r0, 0x20 stest2 : lb r2, (pa) ; if sck = 0 then loop and r2, r3 beqz r2, stest2 addiu r3, r0, 0y00000111 stb r3, (sbi0cr1) ; 0 sbi0dbr ints2 interrupt request sck pin (output) so pin b a 0 a 1 a 2 a 3 a 4 a5 a 6 a 7 b 0 b 1 b 2 b 3 b 4 b 5 b 6 b 7 * clear sios a write transmit data (a) internal clock sbi0dbr ints2 interrupt request sck pin (input) so pin b a 0 a 1 a 2 a 3 a 4 a 5 a 6 a 7 b 0 b 1 b 2 b 3 b 4 b 5 b 6 b 7 * clear sios a write transmit data (b) external clock
tmp1942cy/cz tmp1942cy/cz-308 figure 3.12.24 transmit data retention time when terminating transmission 2) 8-bit receive mode after selecting receive mode in the control register, write a 1 to sbi0cr1, enabling the device to receive data. data is read into the shift register from the si pin synchronously with the serial clock, beginning with the least significant bit. when 8 bits of data have been read, the received data is transferred from the shift regi ster to sbi0dbr and an ints2 (buffer full) interrupt request is generated, requesting that the received data be read out. the received data is read out from sbi0dbr by an interrupt service routine. if an internal clock is being used, the automatic wait function is activated, halting the serial clock until the receive data is read out from sbi0dbr. if an external clock is being used, shift operation is synchronized to the externally sourced clock. the maximum transfer rate for external clock operation thus depends on the maximum delay between an interrupt request being gene rated and the received data being read out. to terminate reception write a 0 to sbi0cr1 or a 1 to sbi0cr1 in the interrupt service routine for the ints2 interr upt. once sbi0cr1 has been cleared, reception will be terminated when all the receive d data bits have been written into sbi0dbr. check sbi0sr in the pr ogram to determine whether reception has been terminated. sbi0sr is reset to 0 upon the termination of reception. after confirming that reception has been terminated, read out the last data item received. if sbi0cr1 has been set to 1, reception will be aborted immediately and sbi0sr cleared to 0. (in that case, the received data is invalid and need not be read out.) note: if the transfer mode is changed during receive oper ation, the contents of sbi0dbr will be lost. if it is necessary to change the transfer mode, first termi nate reception (by writing a 0 to sbi0cr1) and read out the last data received. 7 6 5 4 3 2 1 0 sbi0cr1 0 1 1 1 0 x x x select receive mode. sbi0cr1 1 0 1 1 0 0 0 0 start reception. ints2 interrupt reg. sbiodbr read received data. bit 7 sck pin siof so pin bit 6 t sodh = min. 3.5/f sys /2 [s]
tmp1942cy/cz tmp1942cy/cz-309 figure 3.12.25 receive mode (example with internal clock) 3) 8-bit transmit/receive mode after selecting transmit/receive mode in the control register, write the transmit data to sbi0dbr. then set sbi0cr1 to 1, enabling the device to transmit/receive data. transmit data is output on the so pin at the falling edge of the serial clock starting with the least significant bit, while the received data is read into the shift register from the si pin at the rising edge of the serial cloc k. when 8 bits of data have been read, the received data is transferred from the shift register to sbi0dbr and an ints2 interrupt request is generated. use an interrupt service routine to read out the r eceived data from the data buffer register, then write transmit data to the data buffer register . since sbi0dbr is shared for transmission and reception, always be sure to read out the receiv ed data before writing tr ansmit data to the data buffer register. if an internal clock is being used, the automatic wait function is activated, halting the serial clock until the received data has been read out an d the next transmit data has been written into the data buffer register. if an external clock is being used, since shift operation is synchronized to the externally sourced clock, the received data must be read out and the next transmit data written into the data buffer register before the next shift operation can start. the maximum transfer rate for external clock operation thus depends on the maximum delay between an interrupt request being generated and the received data being read out. when transmission is started, after the sb i0sr goes high, the so pin outputs the final bit of the last transferred data until the falling edge of sck. to terminate transmission/reception write a 0 to sbi0cr1 or a 1 to sbi0cr1 in the interrupt service routine for the ints2 interrupt. once sbi0cr1 has been cleared, transmission/ reception will be terminated when all the received data bits have been written into sbi0 dbr. check sbi0sr in the program to determine whether transmission/reception has been terminated. sbi0sr is reset to 0 upon the termination of transmission/reception. if sbi0cr1 has been set to 1, transmission/reception will be aborted immedi ately and sbi0sr cleared to 0. sbi0dbr ints2 interrupt request sck pin (output) si pin b clear sios a a 0 a 1 a 2 a 3 a 4 a 5 a 6 a 7 b 0 b 1 b 2 b 3 b 4 b 5 b 6 b 7 read received data read received data
tmp1942cy/cz tmp1942cy/cz-310 note: if the transfer mode is changed during transmit/rec eive operation, the contents of sbi0dbr will be lost. if it is necessary to change the transfer mode, first terminate transmission/reception (by writing a 0 to sbi0cr1) and read out the last received data. figure 3.12.26 transmit/receive mode (example with internal clock) figure 3.12.27 transmit data retention ti me when terminating transmission/reception (in transmit/receive mode) 7 6 5 4 3 2 1 0 sbi0cr1 0 1 0 0 0 x x x select transmit mode. sbi0dbr x x x x x x x x write transmit data. sbi0cr1 1 0 0 0 0 x x x start transmission/reception. ints2 interrupt reg. sbiodbr read received data. sbi0dbr x x x x x x x x write transmit data. sbi0dbr ints2 interrupt request sck pin (output) so pin si pin clear sios c 0 c 1 c 2 c 3 c 4 c 5 c 6 c 7 d 0 d 1 d 2 d 3 d 4 d 5 d 6 d 7 write transmit data (a) read received data (d) a 0 a 1 a 2 a 3 a 4 a 5 a 6 a 7 b 0 b 1 b 2 b 3 b 4 b 5 b 6 b 7 * d b c a read received data (c) write transmit data (b) bit 7 of last word transmitted sck pin siof so pin bit 6 t sodh = min. 4/f sys /2 [s]
tmp1942cy/cz 3. 3.13 analog/digital converter analog/digital converter the tmp1942 contains a 10- bit half flash analog / digital converter ( a / d converter ) with sixteen analog input channels . in addition to normal conversion , the converter supports highest - priority conversion mode , in which continuous conversion can be interrupted by conversion for a specific analog channel . the converter also supports an a / d monitor function , which allows the device to compare the value in the specified conversion result register with the value set in the compare register to determine which is greater . this function enables the device to monitor analog quantities without software intervention . the tmp1942 contains a 10- bit half flash analog / digital converter ( a / d converter ) with sixteen analog input channels . in addition to normal conversion , the converter supports highest - priority conversion mode , in which continuous conversion can be interrupted by conversion for a specific analog channel . the converter also supports an a / d monitor function , which allows the device to compare the value in the specified conversion result register with the value set in the compare register to determine which is greater . this function enables the device to monitor analog quantities without software intervention . figure 3.13.1 shows a block diagram of the a / d converter . the pins for the sixteen analog input channels ( an0 - an15 ) are also used as input - only port pins and / or key input pins . figure 3.13.1 shows a block diagram of the a / d converter . the pins for the sixteen analog input channels ( an0 - an15 ) are also used as input - only port pins and / or key input pins . note: when placing the device into idle, sleep or stop mode to reduce the device 's current consumption, check that the a/d converter has stopped operating before ex ecuting the instruction to enter a standby mode. this is necessary because, with some timi ngs, the internal comparator may remain enabled while the device is in a standby mode. when placing the device into slow mode, stop the operation of the a/d converter beforehand. note: when placing the device into idle, sleep or stop mode to reduce the device 's current consumption, check that the a/d converter has stopped operating before ex ecuting the instruction to enter a standby mode. this is necessary because, with some timi ngs, the internal comparator may remain enabled while the device is in a standby mode. when placing the device into slow mode, stop the operation of the a/d converter beforehand. a/d monitor interrupt interrupt request intad an15 (p67) comparator internal data bus multiplexer sample and hold admod1 scan repeat interrupt interval busy end start + ? internal data bus internal data bus channel selection controller adtrg d/a converter normal a/d conversion controller admod0 admod2 admod3 highest-priority a/d conversion termination interrupt end comparison circuit compare register highest-priority a/d conversion termination interrupt a/d monitor controller busy a/d start controller ads hpadce an7/adtrg an0 (p50) vrefh vrefl a/d conversion result registers adreg07l to 8fl adreg07h to 8fh a/d conversion result register adscn intta0/1 admod4 figure 3.13.1 a/d conv erter block diagram figure 3.13.1 a/d conv erter block diagram tmp1942cy/cz-311
tmp1942cy/cz 3.13.1 control registers the a / d converter is controlled by the a / d mode control registers ( admod0 , admod1 , admod2 , admod3 and admod4 ). also , the a / d conversion results are stored in the sixteen a / d conversion result upper / lower registers : adreg08h / l to adreg7fh / l. the results of highest - priority conversion are stored in adregsph / l. figure 3.13.2 shows the registers associated with the a / d converter . a/d mode control register 0 7 6 5 4 3 2 1 0 bit symbol eocfn adbf ri itm1 itm0 repeat scan ads read/write r r/w after reset 0 0 0 0 0 0 0 0 function normal a/d conversion end flag 0: before conversion or conversion in progress 1: conversion completed normal a/d conversion busy flag 0: conversion not in progress 1: conversion in progress repeat interval in repeat mode 0: no interval 1: 8 a/d clock cycles specifies interrupt generation interval in channel-fixed repeated conversion mode specifies interrupt generation interval in channel-fixed repeated conversion mode selects repeat mode 0: single conversion mode 1: repeated conversion mode selects channel scan mode 0: channel -fixed mode 1: channel scan mode starts a/d conversion 0: don?t care 1: starts conversion. this bit is always read as 0. a dmod0 (0xffff_f318) specifies a/d conversion interrupt generation interval in channel-fixed repeated conversion mode channel-fixed repeated conversion mode = 0, = 1 00 generate interrupt every time conversion is performed 01 generate interrupt every fourth time conversion is performed 10 generate interrupt every eighth time conversion is performed 11 setting prohibited in channel-fixed mode, this bit specifies the interval between the end of every conversion, every f ourth conversion or every eighth conversion, as specified with itm1:itm0, and the next conversion being started. in channel scan mode, this bit specifies the interval between the end of a single continuous scan and the next scan being started. figure 3.13.2 a/d conver ter registers (1/12) tmp1942cy/cz-312
tmp1942cy/cz a/d mode control register 1 7 6 5 4 3 2 1 0 bit symbol ? i2ad ? adscn adch3 adch2 adch1 adch0 read/write ? r/w ? r/w r/w after reset ? 0 ? 0 0 0 0 0 function idle 0: idle 1: operate selects channel scan operating mode 0: 4-channel scan 1: 8-channel scan analog input channel selection selects analog input channel 0 channel-fixed 1 channel scan (adscn = 0) 1 channel scan (adscn = 1) 0000 an0 an0 an0 0001 an1 an0 to an1 an0 to an1 0010 an2 an0 to an2 an0 to an2 0011 an3 an0 to an3 an0 to an3 0100 an4 an4 an0 to an4 0101 an5 an4 to an5 an0 to an6 0110 an6 an4 to an6 an0 to an6 0111 (note) an7 an4 to an7 an0 to an7 1000 an8 an8 an8 1001 an9 an8 to an9 an8 to an9 1010 an10 an8 to an10 an8 to an10 1011 an11 an8 to an11 an8 to an11 1100 an12 an12 an8 to an12 1101 an13 an12 to an13 an8 to an13 1110 an14 an12 to an14 an8 to an14 1111 an15 an12 to an15 an8 to an15 note: the an7 pin is shared with the adtrg input. therefore, do not set to 0111 when using the adtrg input with adtrge set to 1. a dmod1 ( 0xffff _ f319 ) figure 3.13.2 a/d conver ter registers (2/12) tmp1942cy/cz-313
tmp1942cy/cz a/d mode control register 2 7 6 5 4 3 2 1 0 bit symbol eocfhp adbfhp ? hpadce hpadch3 hpadch2 hpadch1 hpadch0 read/write r r ? r/w after reset 0 0 ? 0 0 0 0 0 function highest-priority a/d conversion end flag 0: before conversion or conversion in progress 1: conversion completed highest-priority a/d conversion busy flag 0: conversion not in progress 1: conversion in progress starts highest-priority a/d conversion 0: don?t care 1: starts conversion. this bit is always read as 0. analog input channel selection for highest-priority a/d conversion a dmod2 ( 0xffff _ f31a ) analog input channel for highest-priority a/d conversion 0000 an0 0001 an1 0010 an2 0011 an3 0100 an4 0101 an5 0110 an6 0111 an7 1000 an8 1001 an9 1010 an10 1011 an11 1100 an12 1101 an13 1110 an14 1111 an15 figure 3.13.2 a/d conver ter registers (3/12) tmp1942cy/cz-314
tmp1942cy/cz a/d mode control register 3 7 6 5 4 3 2 1 0 bit symbol ? ? adobic regs3 regs2 regs1 regs0 adobsv read/write r/w ? r/w after reset 0 ? 0 0 0 0 0 0 function must always be set to 0. a/d monitor interrupt generation condition 0: less than compare register 1: greater than compare register selects a/d conversion result register to be compared with compare register when a/d monitor function is enabled a/d monito r function 0: disable 1: enable a/d conversion result register to be compared 0000 adreg08 0001 adreg19 0010 adreg2a 0011 adreg3b 0100 adreg4c 0101 adreg5d 0110 adreg6e 0111 adreg7f 1xxx adregsp figure 3.13.2 a/d conver ter registers (4/12) a/d mode control register 4 7 6 5 4 3 2 1 0 bit symbol hadhs hadhtg adhs adhtg ? ? adrst1 adrst0 read/write r/w ? ? w w after reset 0 0 0 0 ? ? ? ? function hardware start source for highest-priori ty a/d conversion 0: external trigger 1: intta1 interrupt hardware start of highest-priori ty a/d conversion 0: disable 1: enable hardware start source for normal a/d conversion 0: external trigger 1: intta0 interrupt hardware start of normal a/d conversion 0: disable 1: enable writing 10 and then 01 triggers the software reset of the a/d converter. note 1: when performing a/d conversion using a hardware star t resource by setting adhtg or hadhtg to 1, observe the following procedure: to use an external trigger , first set p5fc to 1 (adtrg) before enabling hardware start. to use an 8-bit timer, first set adhs or ha dhs to 1 to select the use of a timer interrupt. then, enable hardware start and finally operate the timer to enab le a/d conversion to start at constant intervals. note 2: to change the hardware start resource (from an 8-bit timer to external trigger, or vice versa), first perform a software reset before changing the setting. note 3: to stop using an external trigger (adtrg) to star t a/d conversion, first disable hardware start (by setting adhtg or hadhtg to 0) and then set p5fc to 0 to set the pin to a general-purpose port. figure 3.13.2 a/d conver ter registers (5/12) a dmod4 ( 0xffff _ f31c ) a dmod3 ( 0xffff _ f31b ) tmp1942cy/cz-315
tmp1942cy/cz a/d conversion result lower register 08 7 6 5 4 3 2 1 0 bit symbol adr01 adr00 ? ? ? ? ovr0 adr0rf read/write r ? ? ? ? r r after reset undefined ? ? ? ? 0 0 function stores lower 2 bits of a/d conversion result overrun flag 0: no overrun occurred 1: overrun occurred a/d conversion result store flag 1: conversion result stored a dreg08l ( 0xffff _ f300 ) a/d conversion result upper register 08 7 6 5 4 3 2 1 0 bit symbol adr09 adr08 adr07 adr06 adr05 adr04 adr03 adr02 read/write r after reset undefined function stores upper 8 bits of a/d conversion result a dreg08h ( 0xffff _ f301 ) a/d conversion result lower register 19 7 6 5 4 3 2 1 0 bit symbol adr11 adr10 ? ? ? ? ovr1 adr1rf read/write r ? ? ? ? r r after reset undefined ? ? ? ? 0 0 function stores lower 2 bits of a/d conversion result overrun flag 0: no overrun occurred 1: overrun occurred a/d conversion result store flag 1: conversion result stored a/d conversion result upper register 19 7 6 5 4 3 2 1 0 bit symbol adr19 adr18 adr17 adr16 adr15 adr14 adr13 adr12 read/write r after reset undefined function stores upper 8 bits of a/d conversion result 9 8 7 654 321 0 converted value for channe x 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 bits 2 to 5 are always read as 1s. note1: bit 0 is the a/d conversion result store flag adrxrf. this bit is set to 1 when an a/d converted value is stored in the register pair. this bit is cleared to 0 when the lower register (adregxl) is read. note2: bit 1 is the overrun flag ovrx. this bit is se t to 1 when the next conversion result is written before both conversion result regist ers (adregxh and adregxl) have been read. reading the flag clears the bit. a dreg19h ( 0xffff _ f303 ) adregxh adregxl a dreg19l ( 0xffff _ f302 ) figure 3.13.2 a/d conver ter registers (6/12) tmp1942cy/cz-316
tmp1942cy/cz a/d conversion result lower register 2a 7 6 5 4 3 2 1 0 bit symbol adr21 adr20 ? ? ? ? ovr2 adr2rf read/write r ? ? ? ? r r after reset undefined ? ? ? ? 0 0 function stores lower 2 bits of a/d conversion result overrun flag 0: no overrun occurred 1: overrun occurred a/d conversion result store flag 1: conversion result stored a dreg2al (0xffff_f304) a/d conversion result upper register 2a 7 6 5 4 3 2 1 0 bit symbol adr29 adr28 adr27 adr26 adr25 adr24 adr23 adr22 read/write r after reset undefined function stores upper 8 bits of a/d conversion result a dreg2ah (0xffff_f305) a/d conversion result lower register 3b 7 6 5 4 3 2 1 0 bit symbol adr31 adr30 ? ? ? ? ovr3 adr3rf read/write r ? ? ? ? r r after reset undefined ? ? ? ? 0 0 function stores lower 2 bits of a/d conversion result overrun flag 0: no overrun occurred 1: overrun occurred a/d conversion result store flag 1: conversion result stored a dreg3bl (0xffff_f306) a/d conversion result upper register 3b 7 6 5 4 3 2 1 0 bit symbol adr39 adr38 adr37 adr36 adr35 adr34 adr33 adr32 read/write r after reset undefined function stores upper 8 bits of a/d conversion result a dreg3bh (0xffff_f307) 9 8 7 654 321 0 converted value for channe x 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 bits 2 to 5 are always read as 1s. note1: bit 0 is the a/d conversion result store flag adrxrf. this bit is set to 1 when an a/d converted value is stored in the register pair. this bit is cleared to 0 when the lower register (adregxl) is read. note2: bit 1 is the overrun flag ovrx. this bit is se t to 1 when the next conversion result is written before both conversion result regist ers (adregxh and adregxl) have been read. reading the flag clears the bit. adregxh adregxl figure 3.13.2 a/d conver ter registers (7/12) tmp1942cy/cz-317
tmp1942cy/cz a/d conversion result lower register 4c 7 6 5 4 3 2 1 0 bit symbol adr41 adr40 ? ? ? ? ovr4 adr4rf read/write r ? ? ? ? r r after reset undefined ? ? ? ? 0 0 function stores lower 2 bits of a/d conversion result overrun flag 0: no overrun occurred 1: overrun occurred a/d conversion result store flag 1: conversion result stored a dreg4cl ( 0xffff _ f308 ) a/d conversion result upper register 4c 7 6 5 4 3 2 1 0 bit symbol adr49 adr48 adr47 adr46 adr45 adr44 adr43 adr42 read/write r after reset undefined function stores upper 8 bits of a/d conversion result a dreg4ch (0xffff_f309) a/d conversion result lower register 19 7 6 5 4 3 2 1 0 bit symbol adr51 adr50 ? ? ? ? ovr5 adr5rf read/write r ? ? ? ? r r after reset undefined ? ? ? ? 0 0 function stores lower 2 bits of a/d conversion result overrun flag 0: no overrun occurred 1: overrun occurred a/d conversion result store flag 1: conversion result stored a/d conversion result upper register 19 7 6 5 4 3 2 1 0 bit symbol adr59 adr58 adr57 adr56 adr55 adr54 adr53 adr52 read/write r after reset undefined function stores upper 8 bits of a/d conversion result 9 8 7 654 321 0 converted value for channe x 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 bits 2 to 5 are always read as 1s. note1: bit 0 is the a/d conversion result store flag adrxrf. this bit is set to 1 when an a/d converted value is stored in the register pair. this bit is cleared to 0 when the lower register (adregxl) is read. note2: bit 1 is the overrun flag ovrx. this bit is se t to 1 when the next conversion result is written before both conversion result regist ers (adregxh and adregxl) have been read. reading the flag clears the bit. a dreg5dh (0xffff_f30b) adregxh adregxl a dreg5dl (0xffff_f30a) figure 3.13.2 a/d conver ter registers (8/12) tmp1942cy/cz-318
tmp1942cy/cz a/d conversion result lower register 6e 7 6 5 4 3 2 1 0 bit symbol adr61 adr60 ? ? ? ? ovr6 adr6rf read/write r ? ? ? ? r r after reset undefined ? ? ? ? 0 0 function stores lower 2 bits of a/d conversion result overrun flag 0: no overrun occurred 1: overrun occurred a/d conversion result store flag 1: conversion result stored a dreg6el (0xffff_f30c) a/d conversion result upper register 6e 7 6 5 4 3 2 1 0 bit symbol adr69 adr68 adr67 adr66 adr65 adr64 adr63 adr62 read/write r after reset undefined function stores upper 8 bits of a/d conversion result a dreg6eh (0xffff_f30d) a/d conversion result lower register 7f 7 6 5 4 3 2 1 0 bit symbol adr71 adr70 ? ? ? ? ovr7 adr7rf read/write r ? ? ? ? r r after reset undefined ? ? ? ? 0 0 function stores lower 2 bits of a/d conversion result overrun flag 0: no overrun occurred 1: overrun occurred a/d conversion result store flag 1: conversion result stored a dreg7fl (0xffff_f30e) a/d conversion result upper register 7f 7 6 5 4 3 2 1 0 bit symbol adr79 adr78 adr77 adr76 adr75 adr74 adr73 adr72 read/write r after reset undefined function stores upper 8 bits of a/d conversion result 9 8 7 654 321 0 converted value for channe x 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 bits 2 to 5 are always read as 1s. note1: bit 0 is the a/d conversion result store flag adrxrf. this bit is set to 1 when an a/d converted value is stored in the register pair. this bit is cleared to 0 when the lower register (adregxl) is read. note2: bit 1 is the overrun flag ovrx. this bit is se t to 1 when the next conversion result is written before both conversion result regist ers (adregxh and adregxl) have been read. reading the flag clears the bit. adregxh adregxl a dreg7fh (0xffff_f30f) figure 3.13.2 a/d conver ter registers (9/12) tmp1942cy/cz-319
tmp1942cy/cz tmp1942cy/cz-320 a/d conversion result lower register sp 7 6 5 4 3 2 1 0 bit symbol adrsp1 adrsp0 ? ? ? ? ovrsp adrsprf read/write r ? ? ? ? r r after reset undefined ? ? ? ? 0 0 function stores lower 2 bits of a/d conversion result overrun flag 0: no overrun occurred 1: overrun occurred a/d conversion result store flag 1: conversion result stored a/d conversion result upper register sp 7 6 5 4 3 2 1 0 bit symbol adrsp9 adrsp8 adrsp7 adrsp6 adrsp5 adrsp4 adrsp3 adrsp2 read/write r after reset undefined function stores upper 8 bits of a/d conversion result 9 8 7 654 321 0 converted value for channe x 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 bits 2 to 5 are always read as 1s. note1: bit 0 is the a/d conversion result store flag adrxrf. this bit is set to 1 when an a/d converted value is stored in the register pair. this bit is cleared to 0 when the lower register (adregxl) is read. note2: bit 1 is the overrun flag ovrx. this bit is se t to 1 when the next conversion result is written before both conversion result regist ers (adregxh and adregxl) have been read. reading the flag clears the bit. figure 3.13.2 a/d conver ter registers (10/12) a/d conversion result lower register 7 6 5 4 3 2 1 0 bit symbol adr21 adr20 ? ? ? ? ? ? read/write r/w ? ? ? ? r r after reset undefined ? ? ? ? 0 0 function stores lower 2 bits of a/d conversion result a/d conversion result compare upper register 7 6 5 4 3 2 1 0 bit symbol adr29 adr28 adr27 adr26 adr25 adr24 adr23 adr22 read/write r/w after reset 0 function stores upper 8 bits of a/d conversion result note: when setting or modifying a value in these register s, first disable the a/d monitor function by setting admod3 to 0. figure 3.13.2 a/d conver ter registers (11/12) a dregspl (0xffff_f310) a dregsph (0xffff_f311) adregxh adregxl a dregsph (0xffff_f315) a dregspl (0xffff_f314)
tmp1942cy/cz stores lower 2 bits of a/d conversion result 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? adcck2 adcck1 adcck0 read/write ? ? ? ? ? r/w r/w r/w after reset ? ? ? ? ? 0 0 0 function selects prescaler output for a/d converter 000: fadc 001: divided by 2 010: divided by 4 011: divided by 8 1xx: divided by 16 a dcclk (0xffff_f31f) note 1: a/d conversion is executed using the clock selected by the above register. however, if the accuracy of conversion needs to be guaranteed, be sure to choose a conversion clock frequency such that the conversion period is at least 1 s, that is, 2 mhz or less in terms of a/d conversion clock frequency. note 2: do not change the conversion clock frequency wh ile a/d conversion is in progress. after conversion is completed, wait at least 2 adclk cy cles before changing the clock frequency. adclk2:0 2 adclk 4 8 16 phyt0 figure 3.13.2 a/d conver ter registers (12/12) tmp1942cy/cz-321
tmp1942cy/cz 3.13.2 functional description (1) analog reference voltage apply the high - level analog reference voltage to the vrefh pin and the low - level analog reference voltage to the vrefl pin . vref is automatically turned on when a / d conversion is started and turned off when conversion is completed , thus preventing iref from flowing unnecessarily . (2) selecting the analog input channel the procedure for selecting the analog input channel varies with the a / d converter operating mode . ( 2 - 1 ) analog reference voltage ? using a fixed analog input channel ( admod0 < scan > = 0 ) choose one of the pins an0 to an15 as the analog input channel by setting admod1 < adch3 : adch0 > to the appropriate value . ? scanning analog input channels ( admod0 < scan > = 1 ) choose one of the 24 available scan modes by setting admod1 < adch3 : adch0 > and adscn to the appropriate values . ( 2 - 2 ) highest - priority a / d conversion choose one of the pins an0 to an15 as the analog input channel by setting admod2 < hpadch3 : hpadch0 > to the appropriate value . after a reset , channel - fixed input on the an0 pin is selected since admod0 < scan > and admod1 < adch3 : adch0 > are initialized to 0 and 0000 , respectively . the pins other than that used as the analog input channel can be used as ordinary input port pins . if highest - priority a / d conversion is activated during normal a / d conversion , highest - priority a / d conversion is performed upon the completion of the current conversion cycle. normal a / d conversion is resumed upon the completion of highest - priority a / d conversion . example : when highest - priority a / d conversion for an15 ( admod2 < hpadch3 : hpadch0 > = 1111 ) is activated during repeated scan conversion for channels an0 to an3 ( admod0 < repeat : scan > = 10 and admod1 < adch3 : adch0 > = 0011 ) highest-priority a/d conversion activated ch0 ch1 ch2 ch15 ch3 ch0 ch1 channel converted tmp1942cy/cz-322
tmp1942cy/cz (3) starting a / d conversion a / d conversion is classified into normal a / d conversion and highest - priority a / d conversion . normal a / d conversion can be initiated programmatically by setting admod0 < ads > to 1 . highest - priority a / d conversion can be initiated programmatically by setting admod2 < hpadce > to 1 . normal a / d conversion is performed in one of the four operating modes as specified with admod0 < 2 : 1 >. highest - priority a / d conversion is only performed in channel - fixed single conversion mode . a / d conversion can also be activated by a hardware start source, which is specified with admod4 < adhs > for normal a / d conversion and admod4 < hadhs > for highest - priority a / d conversion . when the adhs or hadhs bit is set to 0 , a / d conversion is triggered by a falling edge on the adtrg pin . when the bit is set to 1 , normal a / d conversion is triggered by intta0 from 8 - bit timer 0 and highest - priority a / d conversion is triggered by intta1 from 8 - bit timer 1 . a / d conversion can still be started programmatically if hardware start is enabled . when normal a / d conversion starts , the normal a / d conversion busy flag ( admod0 < adbf >) is set to 1 , indicating that normal a / d conversion is in progress . when highest - priority a / d conversion starts , the highest - priority a / d conversion busy flag ( admod2 < adbfhp >) is set to 1 , indicating that highest - priority a / d conversion is in progress , with the normal a / d conversion busy flag and end flag ( eocfn ) holding the values they had before highest - priority a / d conversion starts . normal a / d conversion can be restarted by setting admod0 < ads > to 1 during normal a / d conversion . restarting normal a / d conversion cancels the current conversion . however , if all necessary sampling operations have been completed for the current conversion , the conversion result is stored before a / d conversion is restarted . if the start of normal a / d conversion using a hardware resource is enabled , normal a / d conversion is restarted when the start condition for the resource is satisfied during normal a / d conversion . the current conversion is cancelled when normal a / d conversion is restarted . however , if all necessary sampling operations have been completed for the current conversion , the conversion result is stored before a / d conversion is restarted . if admod2 < hpadce > is set to 1 during normal a / d conversion , the result of the current conversion is stored in the conversion result registers , after which highest - priority a / d conversion starts , that is , a / d conversion for the channel specified with admod2 < 3 : 0 > ( channel - fixed single conversion ) starts . once the result of highest - priority conversion is stored in adregsp , normal a / d conversion is resumed following the last conversion for which the result was stored . if the start of highest - priority a / d conversion using a hardware resource is enabled and the start condition for the resource is satisfied during normal a / d conversion , the result of the current conversion is stored in the conversion result registers , after which highest - priority a / d conversion starts , that is , a / d conversion for the channel specified with admod2 < 3 : 0 > ( channel - fixed single conversion ) starts . once the result of highest - priority conversion is stored in adregsp , normal a / d conversion is resumed following the last conversion for which the result was stored . highest - priority a / d conversion is not restarted even if admod2 < hpadce > is set to 1 during highest - priority a / d conversion . tmp1942cy/cz-323
tmp1942cy/cz (4) a / d conversion modes and the a / d conversion completed interrupt the following four a / d conversion modes are available for normal a / d conversion , as specified with the settings of admod0 < 2 : 1 >. highest - priority a / d conversion always operates in channel - fixed single conversion mode regardless of the settings of admod0 < 2 : 1 >. ? channel - fixed single conversion mode ? channel scan single conversion mode ? channel - fixed repeated conversion mode ? channel scan repeated conversion mode ( 4 - 1 ) normal a / d conversion use admod0 < repeat : scan > to select the a / d conversion mode . when a / d conversion has been started , admod0 < adbfn > is set to 1 . when the specified a / d conversion has been completed , an a / d conversion completed interrupt ( intad ) is generated and admod0 < eocf > is set to 1 , indicating that a / d conversion has been completed . if repeat = 0 , adbfn is cleared to 0 simultaneously when eocf is set to 1 . if repeat = 1 , however , conversion continues with adbfn held to be 1 . ( a ) channel - fixed single conversion mode channel - fixed single conversion mode is selected by setting admod0 < repeat : scan > to 00. in this mode , conversion is performed once for a single selected channel . after the conversion has been completed , admod0 < eocf > will be set to 1 and admod0 < adbf > cleared to 0 , thereby generating an intad interrupt request . eocf can be cleared to 0 by reading it. ( b ) channel scan single conversion mode channel scan single conversion mode is selected by setting admod0 < repeat : scan > to 01. in this mode , conversion is performed once for each selected channel which is scanned . after the scan conversion has been completed , admod0 < eocf > will be set to 1 and admod0 < adbf > cleared to 0 , thereby generating an intad interrupt request . eocf can be cleared to 0 by reading it. ( c ) channel - fixed repeated conversion mode channel - fixed repeated conversion mode is selected by setting admod0 < repeat : scan > to 10. in this mode , conversion is performed repeatedly for a single selected channel . after the conversion has been completed , admod0 < eocf > will be set to 1 . admod0 < adbf >, however , remains at 1 and is not cleared to 0 . the timing at which an intad interrupt request will be generated depends on the settings of admod0 < itm1 : itm0 >, which also determine the timing at which eocf is set . eocf can be cleared to 0 by reading it . if admod0 < itm1 : itm0 > = 00, an interrupt request will be generated for each a / d conversion session completed . in that case , the conversion result is always stored in adreg08 . eocf becomes 1 once the conversion result has been stored . tmp1942cy/cz-324
tmp1942cy/cz if admod0 < itm1 : itm0> = 01 , an interrupt request will be generated for every fourth a / d conversion session completed . in that case, the conversion results are stored sequentially in registers adreg08 through adreg3b . eocf becomes 1 once the conversion result has been stored in adreg3b . the next conversion result will be stored in adreg08 again . eocf can be cleared to 0 by reading it. if admod0 < itm1 : itm0> = 10 , an interrupt request will be generated for every eighth a / d conversion session completed . in that case, the conversion results are stored sequentially in registers adreg08 through adreg7f . eocf becomes 1 once the conversion result has been stored in adreg7f . the next conversion result will be stored in adreg08 again . eocf can be cleared to 0 by reading it. the setting of admod0 < ri > determines the repeat interval for repeated conversion mode . if itm1 : itm0 = 00, this bit controls the interval between a single conversion being completed and the next conversion being started . if itm1 : itm0 = 01, the bit controls the interval between four conversions being completed and the next conversion being started . if itm1 : itm0 = 10 , the bit controls the interval between eight conversions being completed and the next conversion being started . ( d ) channel scan repeated conversion mode channel scan repeated conversion mode is selected by setting admod0 < repeat : scan > to 11 . in this mode , conversion is performed repeatedly for selected scanned channels . each time one scan conversion operation has been completed , admod0 < eocf > will be set to 1 , thereby generating an intad interrupt request . admod0 < adbf > remains at 1 and is not cleared to 0 . eocf can be cleared to 0 by reading it. to stop operation in repeat conversion mode ( mode ( c ) or ( d ) ), write a 0 to admod0 < repeat >. repeat conversion mode will then be terminated and admod0 < adbf > cleared to 0 as soon as the conversion currently in progress has been completed . if admod1 < i2ad > = 0 and the device enters a standby state ( idle , sleep or stop mode ), the a / d converter will immediately stop operating , even if a / d conversion is in progress . after the device has exited the standby state, if the a / d converter is operating in repeat conversion mode ( mode ( c ) or ( d ) ), a / d conversion will start again from the beginning ( the register settings remain the same , status information is initialized and operation is restarted from the beginning ); however , if the a / d converter is operating in single conversion mode ( mode ( a ) or ( b ) ), it will not restart conversion operation ( it will remain stopped ). ( 4 - 2 ) highest - priority a / d conversion highest - priority a / d conversion is only performed in channel - fixed single conversion mode , regardless of the settings of admod0 < repeat : scan>. when the start condition is satisfied , conversion for the channel specified with admod2 < hpadch3 : hpadch0 > is performed once . after the conversion has been completed , a highest - priority a / d conversion completed interrupt will be generated , admod2 < eocfhp > set to 1 and < adbfhp > cleared to 0 . the eocfhp flag can be cleared to 0 by reading it. tmp1942cy/cz-325
tmp1942cy/cz tmp1942cy/cz-326 table 3.13.1 relationship among a/d conversion mo des, interrupt generation timing and flag operation admod0 conversion mode interrupt generation timing eocf setting timing (*1) adbf (after interrupt is generated) itm1:0 repeat scan channel-fixed single conversion after conversion has been completed after conversion has been completed 0 ? 0 0 every time one conversion has been completed every time one conversion has been completed 1 (*2) 00 every time four conversions have been completed every time four conversions have been completed 1 (*2) 01 channel-fixed repeated conversion every time eight conversions have been completed every time eight conversions have been completed 1 (*2) 10 1 0 channel scan single conversion after scan conversion has been completed after scan conversion has been completed 0 ? 0 1 channel scan repeated conversion every time one scan conversion has been completed every time one scan conversion has been completed 1 (*2) ? 1 1 (note*1) eocf is cleared when it is read. (note*2) if repeat intervals are used with ri se t to 1, adbf indicates 0 during interval periods. admod0 < ri > can be used to control the time between one scan conversion being completed and the next scan conversion being started ( repeat interval ). this bit is only effective when repeat = 1 . example : when repeated scan for channels an0 to an2 is set repeated scan conversions when ri = 0 repeated scan conversions when ri = 1 note: if the start condition for highest-priority a/d conversion is satisfied during an interval period, highest-priority a/d conversion is started immediately. since the interval counter continues running during highest-priority a/d conversion, the next scan will start when both of the fo llowing conditions are satisfied: an overflow of the interval counter and the completion of highest-priority a/d conversion. (5) highest - priority conversion mode highest - priority a / d conversion can be performed by interrupting normal a / d conversion . highest - priority a / d conversion can be started either programmatically by setting admod2 < hpadce > to 1 or by using a hardware resource as specified with admod4 < 7 : 6 >. if highest - priority a / d conversion is started during normal a / d conversion , the converter first stores the result of the current conversion to the appropriate result register pair , and then performs a single conversion for the channel specified with admod2 < 3 : 0 >. the result of that conversion is stored in adregsp , at which point a highest - priority a / d conversion interrupt is generated . then , normal a / d conversion is resumed following the last conversion for which the result was stored . any condition that triggers highest - priority a / d conversion is ignored while highest - priority a / d conversion is in progress . for example , suppose channel scan repeated conversion is being performed for an0 to an8 . if hpadce is set to 1 during conversion for an3 , the converter will wait for the conversion for an3 channel converted 0 1 2 0 1 2 0 first scan second scan third scan channel converted 0 1 2 1 2 0 first scan second scan 0 interval of 8 adc clock cycles
tmp1942cy/cz to complete and then perform conversion for the channel specified with hpadc3 : hpadc0 . after storing the result of that conversion in adregsp , the converter resumes channel scan repeated conversion from an4 . (6) a / d monitor function setting admod3 < adobsv > to 1 enables the a / d monitor function , which generates an a / d monitor interrupt if the value of the conversion result register specified with regs < 3 : 0 > is greater or less ( as specified with adobic ) than the value of the compare register . this comparison is performed each time the result is stored in the specified conversion result register , and an interrupt is generated if the condition is satisfied . since the conversion result register used for the a / d monitor function is usually not read in the program , its overrun flag ( ovrn ) and conversion result store flag ( adrnrf ) are always set . therefore , do not use those flags of the conversion result register used for the a / d monitor function . (7) a / d conversion time two clock pulses are required for a single a / d conversion . the a / d conversion clock frequency can be selected from among prescaler outputs phyt0 , phyt1 , phyt2 , phyt4 and phyt8 . to guarantee the accuracy of the conversion , the a / d conversion time must be at least 1 s, that is , 2 mhz or less in terms of a / d conversion clock frequency . the following figure and tables show example settings : example : repeated scan conversion for channels 0 to 2 ( adc clock frequency = 1 mhz ) set-up smp save smp cmp adc 1 clock (1 m@max) cmp smp cmp save smp cmp save 4 5 clcok (4 to 5 sec) 4 clock (4 sec) 4 clcok (4 sec) 2 clcok (2 sec) 2 clcok (2 sec) conversion for channel 0 conversion for channel 1 conversion for channel 2 conversion for channel 0 start conversion smp: sample hold cmp: a/d conversion save: store result tmp1942cy/cz-327
tmp1942cy/cz table 3.13.2 example a/d conversion settings (1) @f = 32 mhz a/d conversion time peripheral clock select < fpsel > clock gear < gear1 : 0 > prescaler clock source < prck1 : 0 > t0 t1 t2 t4 t8 00 (fperiph/4) invalid setting invalid setting 1 s 2 s 4 s 01 (fperiph/2) invalid setting invalid setting invalid setting 1 s 2 s 00 (fc) 10 (fperiph) invalid setting invalid setting invalid setting invalid setting 1 s 00 (fperiph/4) invalid setting 1 s 2 s 4 s 8 s 01 (fperiph/2) invalid setting invalid setting 1 s 2 s 4 s 01 (fc/2) 10 (fperiph) invalid setting invalid setting invalid setting 1 s 2 s 00 (fperiph/4) 1 s 2 s 4 s 8 s 16 s 01 (fperiph/2) invalid setting 1 s 2 s 4 s 8 s 10 (fc/4) 10 (fperiph) invalid setting invalid setting 1 s 2 s 4 s 00 (fperiph/4) 2 s 4 s 8 s 16 s 32 s 01 (fperiph/2) 1 s 2 s 4 s 8 s 16 s 0 (fgear) 11 (fc/8) 10 (fperiph) invalid setting 1 s 2 s 4 s 8 s 00 (fperiph/4) invalid setting invalid setting 1 s 2 s 4 s 01 (fperiph/2) invalid setting invalid setting invalid setting 1 s 2 s 00 (fc) 10 (fperiph) invalid setting invalid setting invalid setting invalid setting 1 s 00 (fperiph/4) invalid setting 1 s 2 s 4 s 8 s 01 (fperiph/2) invalid setting invalid setting 1 s 2 s 4 s 01 (fc/2) 10 (fperiph) invalid setting invalid setting invalid setting 1 s 2 s 00 (fperiph/4) 1 s 2 s 4 s 8 s 16 s 01 (fperiph/2) invalid setting 1 s 2 s 4 s 8 s 10 (fc/4) 10 (fperiph) invalid setting invalid setting 1 s 2 s 4 s 00 (fperiph/4) 2 s 4 s 8 s 16 s 32 s 01 (fperiph/2) 1 s 2 s 4 s 8 s 16 s 1 (fc) 11 (fc/8) 10 (fperiph) invalid setting 1 s 2 s 4 s 8 s tmp1942cy/cz-328
tmp1942cy/cz table 3.13.3 example a/d conversion settings (2) @f = 32 mhz conversion clock phyt0 f adc f adc /2 f adc /4 f adc /8 f adc /16 16mhz invalid setting invalid setting invalid setting invalid setting 2 sec 12 mhz invalid setting invalid setting invalid setting invalid setting 2.8 sec 10 mhz invalid setting invalid setting invalid setting invalid setting 3.2 sec 8 mhz invalid setting invalid setting invalid setting 2 sec 4 sec 4 mhz invalid setting invalid setting 2 sec 4 sec 8 sec 2mhz invalid setting 2 sec 4 sec 8 sec 16 sec note: the maximum conversion speed, that is, the minimu m conversion time this a/d converter can achieve is 2 s. however, 4 s is required before the first conversion result ca n be retrieved from the conversion result register (or a maximum of 5 s is required depending on the conversion star t request timing because of the interface between the system clock and a/d conversion clock). subsequently, conversion results can be obtained every 2 s. therefore, in single conversion mode or highest-priority conversion mode, a/d conversion requires 4 or 5 times the conversion time shown in the above table. in repeated conversion or scan mode, only the first conversion requires 4 or 5 times the table value (a maximum of 4 to 5 s) but subsequent conversions are performed within the time shown in the table (a maximum of 2 s). tmp1942cy/cz-329
tmp1942cy/cz tmp1942cy/cz-330 (8) storing and reading out a / d conversion results a / d conversion results are stored in a / d conversion result upper / lower registers ( adreg08h / l to adreg7fh / l). in channel - fixed repeated conversion mode , a / d conversion results are sequentially stored in adreg08h / l to adreg7fh / l. however , if itm1 and itm0 specify that an interrupt be generated every time conversion has been completed , conversion results will be stored in adreg08h / l only . if itm1 and itm0 specify that an interrupt be generated every fourth time conversion has been completed , conversion results will be sequentially stored in adreg08h / l to adreg3bh / l. table 3.13. 3 shows the relationship between analog input channels and a / d conversion result registers . table 3.13.3 relationship between analog input channels and a/d conversion result registers a/d conversion result register analog input channel (port a) other than channel-fixed repeated conversion mode channel-fixed repeated conversion mode (every eighth time) an0 adreg08h/l an1 adreg19h/l an2 adreg2ah/l an3 adreg3bh/l an4 adreg4ch/l an5 adreg5dh/l an6 adreg6eh/l an7 adreg7fh/l an8 adreg08h/l an9 adreg19h/l an10 adreg2ah/l an11 adreg3bh/l an12 adreg4ch/l an13 adreg5dh/l am14 adreg6eh/l am15 adreg7fh/l adreg08h/l adreg7fh/l in highest - priority a / d conversion mode , conversion results are always stored in adregsph / l. (9) data polling to process the results of a / d conversion by means of data polling rather than using an interrupt , poll admod0 < eocf >. if this flag is set , the appropriate a / d conversion result register pair contains the conversion result . check the flag and then , if it is set , read the a / d conversion result registers . to detect an overrun , first read the upper register and then the lower register . the conversion result is valid if ovrn = 0 and adrnrf = 1 in the lower register . = 00 adreg08h/l = 01 adreg08h/l adreg3bh/l = 10 adreg08h/l adreg7fh/l
tmp1942cy/cz 3. 3.14 digital/analog converter 3.14 digital/analog converter this section describes the d / a converter the tmp1942 contains . this section describes the d / a converter the tmp1942 contains . 3.14.1 features 3.14.1 features ? three 10 - bit d / a converter channels . ? three 10 - bit d / a converter channels . ? each channel contains a full- range buffer amplifier . ? each channel contains a full- range buffer amplifier . ? each channel can be placed in standby state using control registers . ? each channel can be placed in standby state using control registers . 3.14.2 operation 3.14.2 operation when the op and refon bits of the control register daccntn are set to 1s , writing output code and the va l i d bit to the output register pair daregnl / daregnh causes the voltage corresponding to the output code to appear on the daoutn output pin . the value in the output registers will be reflected in daout only if the va l i d bit is set . therefore , when updating the code , set the va l i d bit if 10- bit data has been updated in daregnh first and then daregnl . once the va l i d bit has been set to 1 , the value stored in daregnl / h is fetched into the d / a converter as 10 - bit data , which will be recognized as code . setting daccntn < op > to 0 places the daoutn output pin into the high - impedance state . setting daccntn < refon> to 0 enables reduction of current consumption by decreasing iref . when the op and refon bits of the control register daccntn are set to 1s , writing output code and the va l i d bit to the output register pair daregnl / daregnh causes the voltage corresponding to the output code to appear on the daoutn output pin . the value in the output registers will be reflected in daout only if the va l i d bit is set . therefore , when updating the code , set the va l i d bit if 10- bit data has been updated in daregnh first and then daregnl . once the va l i d bit has been set to 1 , the value stored in daregnl / h is fetched into the d / a converter as 10 - bit data , which will be recognized as code . setting daccntn < op > to 0 places the daoutn output pin into the high - impedance state . setting daccntn < refon> to 0 enables reduction of current consumption by decreasing iref . tmp1942cy/cz-331 controller daregnl daregnh w internal dareg (10 bits) v clr controller figure 3 . 14. 1 d / a converter block diagram figure 3 . 14. 1 d / a converter block diagram darefhh avss daoutn daccntn refonn opn resistor section amplifier 8 2 10 dac system diagram for dacn
tmp1942cy/cz tmp1942cy/cz-332 daccnt0 register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? ? refon0 op0 read/write ? ? ? ? ? ? r/w r/w after reset ? ? ? ? ? ? 0 0 function 0: ref off 1: ref on 0: output high-impe dance 1: output daccnt1 register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? ? refon1 op1 read/write ? ? ? ? ? ? r/w r/w after reset ? ? ? ? ? ? 0 0 function 0: ref off 1: ref on 0: output high-impe dance 1: output daccnt2 register 7 6 5 4 3 2 1 0 bit symbol ? ? ? ? ? ? refon2 op2 read/write ? ? ? ? ? ? r/w r/w after reset ? ? ? ? ? ? 0 0 function 0: ref off 1: ref on 0: output high-impe dance 1: output output register dareg0l 7 6 5 4 3 2 1 0 bit symbol dac01 dac00 ? ? ? ? ? valid read/write r/w r/w r/w r/w ? ? ? w after reset 0 0 0 0 ? ? ? 0 function must always be set to 0. must always be set to 0. 0: don?t care 1: output code valid output register dareg0h 7 6 5 4 3 2 1 0 bit symbol dac09 dac08 dac07 dac06 dac05 dac04 dac03 dac02 read/write r/w after reset 0 0 0 0 0 0 0 0 function note: when writing data to dareg0, first write dareg0h and then dareg0l, using byte accesses. (0xffff_f342) (0xffff_f341) (0xffff_f346) (0xffff_f34a) (0xffff_f340)
tmp1942cy/cz tmp1942cy/cz-333 output register dareg1l 7 6 5 4 3 2 1 0 bit symbol dac1 dac0 ? ? ? ? ? valid read/write r/w r/w r/w r/w ? ? ? w after reset 0 0 0 0 ? ? ? 0 function must always be set to 0. must always be set to 0. 0: ref off 1: ref on 0: don't care 1: output code valid output register dareg1h 7 6 5 4 3 2 1 0 bit symbol dac9 dac8 dac7 dac6 dac5 dac4 dac3 dac2 read/write r/w after reset 0 0 0 0 0 0 0 0 function output register dareg2l 7 6 5 4 3 2 1 0 bit symbol dac1 dac0 ? ? ? ? ? valid read/write r/w r/w r/w r/w ? ? ? w after reset 0 0 0 0 ? ? ? 0 function must always be set to 0. must always be set to 0. 0: don't care 1: output code valid output register dareg2h 7 6 5 4 3 2 1 0 bit symbol dac9 dac8 dac7 dac6 dac5 dac4 dac3 dac2 read/write r/w after reset 0 0 0 0 0 0 0 0 function note: when writing data to dareg1 and dareg0, fi rst write daregnh and then daregnl, using byte accesses. (0xffff_f344) (0xffff_f345) (0xffff_f348) (0xffff_349)
tmp1942cy/cz 3. 3.15 key on wake-up circuit 3.15.1 overview ? 14 inputs , key0 to keyd , can be used to terminate stop / sleep mode or as an external interrupt . however , all 14 inputs must be set collectively ( in the cg block ). whether individual pins are used or not used can be specified separately ( kwupstn ). ? a single interrupt source is available . ? rising edge , falling edge , high level , or low level detection can be selected for individual inputs ( kwupstn ). ? the interrupt source is cleared by kwupclr in the interrupt handling routine . ? key input pins have pull - up resistors which can be enabled or disabled by setting bit 0 ( pe) of kwupcnt . bit 1 ( dpe ) specifies whether the pull - up resistors are dynamic or static . pull- up resistors cannot be set individually . 3.15.2 key on wake-up operation the tmp1942 has 14 key input pins ( key0 to keyd ). the kwupen bit of the imcgb1 register in the cg specifies whether the key inputs are used to terminate standby mode or as an ordinary interrupt . setting the bit to 1 causes all of key0 to keyd to be used to terminate standby mode . use kwupstn < keynen > to specify whether to use each key input and kwupstn < keyn1 : keyn0 > to specify the active condition for each key input . the key on wake - up circuit detects key inputs and reports the result of detection to the cg imcgb1 register using an active high signal . therefore , set the detection level to high level by setting imcgb1< emcg51 : emcg50 > to 01. since the result of detection in the cg is also reported to the interrupt controller ( intc ) as an active high signal , set the corresponding interrupt to high level - detected in the intc . setting imcgb1< kwupen > to 0 ( default ) causes all of key0 to keyd to be used as ordinary interrupts . in that case, set the detection level to high level in the intc but the cg need not be set . also use kwupstn to specify whether each key input is used and its active condition . in the interrupt handling routine , write 1010 to kwupclr to clear all key interrupts . note: if two or more key inputs are detected at different times, the second key input is cleared simultaneously with the first key input if the second key input is detected before the key interrupt clearing sequence in the interrupt handling routi ne for the first key input. if the second key input is detected after the clearing sequence for the first key input, a key interrupt will be generated again. 3.15.3 pull-up function each key input has a pull - up resistor . setting kwupcnt < pe> to 1 results in all of key0 to keyd being pulled up. however , any key inputs which have been specified not to be used with kwupstn < keynen > will not be pulled up regardless of the setting of this bit . setting kwupcnt < dpe > to 1 selects dynamic pull - up mode , where the key inputs are pulled up only during given periods at a frequency specified with t1s1 : t1s0 and t2s1 : t2s0 . in this mode , current consumed by the key inputs can be reduced . when dpe is set to 0 , the key inputs are always pulled up. tmp1942cy/cz-334
tmp1942cy/cz note1: procedures for using key inputs in static pull-up mode a ) when setting key inputs first after powering up the device 1 ) set kwupcnt ( pe = 1 , dpe = 0 ). 2 ) set the kwupstn < keynen > corresponding to the key inputs to be used to 1 . 3 ) wait until the pull - up resistors are disabled . 4 ) set the active conditions using the kwupstn corresponding to the key inputs to be used . 5 ) clear the interrupt request using kwupclr . 6 ) set the cg and intc ( refer to section 3 . 4 , ? interrupts ? for details ). b ) when modifying the active condition for a key input during operation 1 ) disable key interrupts in the intc ( imc1 < 18 : 16 > = 000 ). 2 ) modify the active condition for the key input using the corresponding kwupstn . 3 ) clear the interrupt request using kwupclr . 4 ) enable key interrupts in the intc ( set imc1 < 18: 16 > to an appropriate level ). c ) when enabling a key input during operation 1 ) disable key interrupts in the intc ( imc1 < 18 : 16 > = 000 ). 2 ) set the kwupstn < keynen > corresponding to the key input to be used to 1 . 3 ) wait until the pull - up resistors are disabled . 4 ) set the active condition using the kwupstn corresponding to the key input to be used . 5 ) clear the interrupt request using kwupclr . 6 ) enable key interrupts in the intc ( set imc1 < 18: 16 > to an appropriate level ). note2 : procedures for using key inputs in dynamic pull-up mode a ) when setting key inputs first after powering up the device 1 ) set kwupcnt ( pe = 1 , dpe = 0 , tnsn = desired time ). 2 ) set the active conditions using the kwupstn corresponding to the key inputs to be used . 3 ) clear the interrupt request using kwupclr . 4 ) set the kwupstn < keynen > corresponding to the key inputs to be used to 1 . 5 ) set the cg and intc ( refer to section 3 . 4 , ? interrupts ? for details ). b ) when modifying the active condition for a key input during operation 1 ) disable key interrupts in the intc ( imc1 < 18 : 16 > = 000 ). 2 ) modify the active condition for the key input using the corresponding kwupstn . 3 ) clear the interrupt request using kwupclr . 4 ) enable key interrupts in the intc ( set imc1 < 18: 16 > to an appropriate level ). c ) when enabling a key input during operation 1 ) disable key interrupts in the intc ( imc1 < 18 : 16 > = 000 ). 2 ) set the active condition using the kwupstn corresponding to the key input to be used . 3 ) clear the interrupt request using kwupclr . 4 ) set the kwupstn < keynen > corresponding to the key input to be used to 1 . 5 ) enable key interrupts in the intc ( set imc1 < 18: 16 > to an appropriate level ). tmp1942cy/cz-335
tmp1942cy/cz note3: procedures for using key inputs without pull-up resistors a ) when setting key inputs first after powering up the device 1 ) set kwupcnt ( pe = 0 , dpe = 0 ). 2 ) set the active conditions using the kwupstn corresponding to the key inputs to be used . 3 ) clear the interrupt request using kwupclr . 4 ) set the kwupstn < keynen > corresponding to the key inputs to be used to 1 . 5 ) set the cg and intc ( refer to section 3 . 4 , ? interrupts ? for details ). b ) when modifying the active condition for a key input during operation 1 ) disable key interrupts in the intc ( imc1 < 18 : 16 > = 000 ). 2 ) modify the active condition for the key input using the corresponding kwupstn . 3 ) clear the interrupt request using kwupclr . 4 ) enable key interrupts in the intc ( set imc1 < 18: 16 > to an appropriate level ). c ) when enabling a key input during operation 1 ) disable key interrupts in the intc ( imc1 < 18 : 16 > = 000 ). 2 ) set the active condition using the kwupstn corresponding to the key input to be used . 3 ) clear the interrupt request using kwupclr . 4 ) set the kwupstn < keynen > corresponding to the key input to be used to 1 . 5 ) enable key interrupts in the intc ( set imc1 < 18: 16 > to an appropriate level ). note: ensure that fs is operating before attempting to enable dynamic pull-up by setting dpe to 1. if dpe is set to 1 when fs is not operating, key inputs cannot be detected. tmp1942cy/cz-336
tmp1942cy/cz tmp1942cy/cz-337 key on wake-up control register kwupcnt 7 6 5 4 3 2 1 0 bit symbol ? ? t2s1 t2s0 t1s1 t1so dpe kype read/write r/w ? r/w after reset 0 ? ? ? ? ? 0 0 function must always be set to 0. dynamic pull-up interval 00: 128/fs 10: 512 /fs 01: 256/fs 11: 1024/fs dynamic pull-up period 00: 4/fs 10: 16/fs 01: 8/fs 11: 32/fs 0: static pull-up 1: dynamic pull-up 0: disable pull-up 1: enable pull-up the following illustrates operation in dynamic pull - up mode : key inputs are pulled up only during the t1 periods as specified with t1s1 : t1s0 . 00: 4 / fs ( 125 s @ fs = 32khz ) 01: 8 / fs ( 250 s @ fs = 32khz ) 10: 16 / fs ( 500 s @ fs = 32khz ) 11 : 32/ fs ( 1 ms @ fs = 32khz ) dynamic pull - up is repeated at intervals of t2 as specified with t2s1 : t2s0 . 00: 128 / fs ( 4 ms @ fs = 32khz ) 01: 256 / fs ( 8 m @ fs = 32khz s) 10: 512 / fs ( 16 ms @ fs = 32khz ) 11 : 1024 / fs ( 32 ms @ fs = 32khz ) 3.15.4 detecting key inputs and detection timing 1) when pull - up resistors are disabled with pe set to 0 kwupstn < keyn1 : 0 > can be used to specify a high level , low level , rising edge or falling edge as the active condition for key inputs . the active condition for key inputs is constantly monitored . 2) in static pull - up mode with pe set to 1 and dpe set to 0 kwupstn < keyn1 : 0 > can be used to specify a high level , low level , rising edge or falling edge as the active condition for key inputs . the active condition for key inputs is constantly monitored . 3) in dynamic pull - up mode with pe set to 1 and dpe set to 1 the active condition for each key input ( interrupt ) is detected one fs clock cycle before the t1 period ends . only edge detection is supported . therefore , key input must be asserted for at least a period of t2 . in this case, do not set the active condition to a level . there is a delay of up to t2 before detection . the following figure shows an example when the active condition is a falling edge . (0xffff_f371) t1 t2 pull-up key input interrupt detection timing key input detected low for t2 or longer h or high-z or l result of internal sampling h or high-z
tmp1942cy/cz 7 6 5 4 3 2 1 0 kwupst0 bit symbol ? ? key01 key00 ? ? ? key0en (0xffff_f360) read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function sets key0 active condition 00: low level 01: high level 10: falling edge 11: rising edge k e y 0 interrupt input 0: disable 1: enable 7 6 5 4 3 2 1 0 kwupst1 bit symbol ? ? key11 key10 ? ? ? key1en (0xffff_f361) read/write ? ? r/w ? ? r/w after reset ? ? 1 0 ? ? ? 0 function sets key1 active condition 00: low level 01: high level 10: falling edge 11: rising edge k e y 1 interrupt input 0: disable 1: enable 7 6 5 4 3 2 1 0 kwupst2 bit symbol ? ? key21 key20 ? ? ? key2en (0xffff_f362) read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function sets key2 active condition 00: low level 01: high level 10: falling edge 11: rising edge k e y 2 interrupt input 0: disable 1: enable 7 6 5 4 3 2 1 0 kwupst3 bit symbol ? ? key31 key30 ? ? ? key3en (0xffff_f363) read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function sets key3 active condition 00: low level 01: high level 10: falling edge 11: rising edge k e y 3 interrupt input 0: disable 1: enable 7 6 5 4 3 2 1 0 kwupst4 bit symbol ? ? key41 key40 ? ? ? key4en (0xffff_f364) read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function sets key4 active condition 00: low level 01: high level 10: falling edge 11: rising edge k e y 4 interrupt input 0: disable 1: enable tmp1942cy/cz-338
tmp1942cy/cz 7 6 5 4 3 2 1 0 kwupst5 bit symbol ? ? key51 key50 ? ? ? key5en (0xffff_f365) read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function sets key5 active condition 00: low level 01: high level 10: falling edge 11: rising edge k e y 5 interrupt input 0: disable 1: enable 7 6 5 4 3 2 1 0 kwupst6 bit symbol ? ? key61 key60 ? ? ? key6en (0xffff_f366) read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function sets key6 active condition 00: low level 01: high level 10: falling edge 11: rising edge k e y 6 interrupt input 0: disable 1: enable 7 6 5 4 3 2 1 0 kwupst7 bit symbol ? ? key71 key70 ? ? ? key7en (0xffff_f367) read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function sets key7 active condition 00: low level 01: high level 10: falling edge 11: rising edge k e y 7 interrupt input 0: disable 1: enable 7 6 5 4 3 2 1 0 kwupst8 bit symbol ? ? key81 key80 ? ? ? key8en (0xffff_f368) read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function sets key8 active condition 00: low level 01: high level 10: falling edge 11: rising edge k e y 8 interrupt input 0: disable 1: enable 7 6 5 4 3 2 1 0 kwupst9 bit symbol ? ? key91 key90 ? ? ? key9en (0xffff_f369) read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function sets key9 active condition 00: low level 01: high level 10: falling edge 11: rising edge k e y 9 interrupt input 0: disable 1: enable tmp1942cy/cz-339
tmp1942cy/cz 7 6 5 4 3 2 1 0 kwupsta bit symbol ? ? keya1 keya0 ? ? ? keyaen (0xffff_f36a) read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function sets keya active condition 00: low level 01: high level 10: falling edge 11: rising edge k e y a interrupt input 0: disable 1: enable 7 6 5 4 3 2 1 0 kwupstb bit symbol ? ? keyb1 keyb0 ? ? ? keyben (0xffff_f36b) read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function sets keyb active condition 00: low level 01: high level 10: falling edge 11: rising edge k e y b interrupt input 0: disable 1: enable 7 6 5 4 3 2 1 0 kwupstc bit symbol ? ? keyc1 keyc0 ? ? ? keycen (0xffff_f36c) read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function sets keyc active condition 00: low level 01: high level 10: falling edge 11: rising edge k e y c interrupt input 0: disable 1: enable 7 6 5 4 3 2 1 0 kwupstd bit symbol ? ? keyd1 keyd0 ? ? ? keyden (0xffff_f36d) read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function sets keyd active condition 00: low level 01: high level 10: falling edge 11: rising edge k e y d interrupt input 0: disable 1: enable 7 6 5 4 3 2 1 0 kwupclr bit symbol ? ? ? ? keyclr3 keyclr2 keyclr1 keyclr0 (0xffff_f370) read/write ? ? w after reset ? ? ? ? ? ? ? ? function writing 1010 clears all key sources. tmp1942cy/cz-340
tmp1942cy/cz 3.16 intb, intc, intd, inte the tmp1942 supports extended interrupts intb , intc , intd and inte . these four interrupts are internally ored and the result is input to the cg and intc . therefore , they represent a single interrupt source. you can determine which interrupt has actually occurred by checking the corresponding bits of intflg . these flags are cleared when read . ? can be used to terminate stop / sleep mode ( wake - up ) or as an external interrupt . when used for wake - up, all four interrupts must be set collectively ( in the cg block ). whether individual pins are used or not used can be specified separately ( intnst ). ? a single interrupt source is available ( intbcde ). ? rising edge , falling edge , high level , or low level detection can be selected for individual inputs ( intnst ). ? the interrupt source is cleared by reading intflg in the interrupt handling routine . ? which interrupt has occurred can be determined using the intflg register . 7 6 5 4 3 2 1 0 intbst bit symbol ? ? intb1 intb0 ? ? ? intben (0xffff_f380) read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function sets intb active condition 00: low level 01: high level 10: falling edge 11: rising edge i n t b interrupt input 0: disable 1: enable 7 6 5 4 3 2 1 0 intcst bit symbol ? ? intc1 intc0 ? ? ? intcen (0xffff_f381) read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function sets intc active condition 00: low level 01: high level 10: falling edge 11: rising edge i n t c interrupt input 0: disable 1: enable 7 6 5 4 3 2 1 0 intdst bit symbol ? ? intd1 intd0 ? ? ? intden (0xffff_f382) read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function sets intd active condition 00: low level 01: high level 10: falling edge 11: rising edge i n t d interrupt input 0: disable 1: enable tmp1942cy/cz-341
tmp1942cy/cz 7 6 5 4 3 2 1 0 intest bit symbol ? ? inte1 inte0 ? ? ? inteen (0xffff_f383) read/write ? ? r/w ? ? ? r/w after reset ? ? 1 0 ? ? ? 0 function sets inte active condition 00: low level 01: high level 10: falling edge 11: rising edge i n t e interrupt input 0: disable 1: enable 7 6 5 4 3 2 1 0 intflg bit symbol ? ? ? ? intes intds intcs intbs (0xffff_f384) read/write ? ? ? ? r after reset ? ? ? ? 0 0 0 0 function 0: interrupt not generated 1: interrupt generated 0: interrupt not generated 1: interrupt generated 0: interrupt not generated 1: interrupt generated 0: interrupt not generated 1: interrupt generated note: setting procedures a ) when setting int inputs first after powering up the device 1 ) set the active conditions using the intnst corresponding to the interrupt inputs to be used . 2 ) clear the interrupt request by reading intflg . 3 ) set the intnst < intnen > corresponding to the interrupt inputs to be used to 1 . 4 ) set the cg and intc ( refer to section 3 . 4 , ? interrupts ? for details ). b ) when modifying the active condition for an int input during operation 1 ) disable intbcd interrupts in the intc ( imc1 < 26: 24 > = 000 ). 2 ) modify the active condition for the int input using the corresponding intnst . 3 ) clear the interrupt request by reading intflg . 4 ) enable intbcd interrupts in the intc ( set imc1 < 26 : 24 > to an appropriate level ). c ) when enabling an int input during operation 1 ) disable intbcd interrupts in the intc ( imc1 < 26: 24 > = 000 ). 2 ) set the active condition using the intnst corresponding to the interrupt input to be used . 3 ) clear the interrupt request by reading intflg . 4 ) set the intnst < intnen > corresponding to the interrupt input to be used to 1 . 5 ) enable intbcd interrupts in the intc ( set imc1 < 26 : 24 > to an appropriate level ). tmp1942cy/cz-342
tmp1942cy/cz 3.17 rom correction function this section describes the rom correction function the tmp1942 supports . the tmp1942 , however , only supports the registers used for the rom correction function . when debugging the rom correction function , therefore , use the rom correction circuit only to replace the contents of the registers and check subsequent operation by rewriting data in the appropriate flash memory areas. the mask rom version of the product supports the full rom correction function . 3.17.1 features ? can replace data at four locations : 8 words for each . ? when the pc value or the address generated by the dmac matches the address stored in an address register ( including 5 low - order ? don?t care ? bits ), the data from the corresponding rom correction data register located in ram will be used in place of the rom data at that address . ? rom correction is automatically enabled by setting an address in an address register . ? if it is necessary to correct more than eight words in rom , for example , when modifying a program , place a instruction for jumping to a ram address in the data register in ram so that you can correct data within ram . 3.17.2 operation by setting the physical address of a rom area ( including a projected area) in the address register addregn , you can substitute the data from the data register in ram corresponding to the addregn for the rom data at that address . setting an address in addregn automatically enables the rom correction function . upon a reset , the entire rom correction function is disabled . therefore , to perform rom correction in the initial routine after the reset process completes , set an address in an appropriate address register . the rom correction function is enabled for the address register ( s ) for which an address is set , so that rom data will be replaced if the address matches with the value of the pc ( when the cpu holds bus control ) or if it matches with the source or destination address generated by the dmac ( when the dmac holds bus control ). for example , setting addresses in addreg0 and addreg3 enables rom correction for the corresponding areas , so that an address match will constantly be monitored for these address registers and if the addresses match , rom data will be replaced . in that case, rom correction will not be performed for addreg2 and addreg4 . although the address registers have bits 31: 5 , an address match is detected only for a < 18: 5 > to simplify the circuit . internally , the romcs signal which indicates the rom area and the match detection from the rom correction circuit are logically anded . rom correction addresses can only be specified on 8 - word boundaries ( that is , a0 to a4 are 0 ). this means data is replaced in 32 - byte units . to replace only part of 32 bytes , write the same data for the addresses for which no replacement is required . the following table shows the relationship between addregn and the ram areas: address register corresponding ram area addreg0 0xffff_bf80 0xffff_bf9f addreg1 0xffff_bfa0 0xffff_bfbf addreg2 0xffff_bfc0 0xffff_bfdf addreg3 0xffff_bfe0 0xffff_bfff tmp1942cy/cz-343
tmp1942cy/cz tmp1942cy/cz-344 figure 3.17.1 rom correction system diagram address register addregn compare circuit selector operand address instruction address rom selector operand data instruction data tx19/l mpu gbif g-bus a ddregn write detection and hold circuit comparison contained in tmp1942fd ram conversion circuit
tmp1942cy/cz 3.17.3 registers (1) address registers 7 6 5 4 3 2 1 0 addreg0 bit symbol add07 add06 add05 ? ? ? ? ? (0xffff_e540) read/write r/w ? after reset 0 0 0 ? ? ? ? ? function 15 14 13 12 11 10 9 8 bit symbol add015 add014 add013 add012 add011 add010 add09 add08 read/write r/w after reset 0 0 0 0 0 0 0 0 function 23 22 21 20 19 18 17 16 bit symbol add023 add022 add021 add020 add019 add018 add017 add016 read/write r/w after reset 0 0 0 0 0 0 0 0 function 31 30 29 28 27 26 25 24 bit symbol add031 add030 add029 add028 add027 add026 add025 add024 read/write r/w after reset 0 0 0 0 0 0 0 0 function 7 6 5 4 3 2 1 0 addreg1 bit symbol add07 add06 add05 ? ? ? ? ? (0xffff_e544) read/write r/w ? after reset 0 0 0 ? ? ? ? ? function 15 14 13 12 11 10 9 8 bit symbol add015 add014 add13 add012 add011 add010 add09 add08 read/write r/w after reset 0 0 0 0 0 0 0 0 function 23 22 21 20 19 18 17 16 bit symbol add023 add022 add021 add020 add019 add018 add017 add016 read/write r/w after reset 0 0 0 0 0 0 0 0 function 31 30 29 28 27 26 25 24 bit symbol add031 add030 add029 add028 add027 add026 add025 add024 read/write r/w after reset 0 0 0 0 0 0 0 0 function tmp1942cy/cz-345
tmp1942cy/cz 7 6 5 4 3 2 1 0 addreg2 bit symbol add07 add06 add05 ? ? ? ? ? (0xffff_e548) read/write r/w ? after reset 0 0 0 ? ? ? ? ? function 15 14 13 12 11 10 9 8 bit symbol add015 add014 add013 add012 add011 add010 add09 add08 read/write r/w after reset 0 0 0 0 0 0 0 0 function 23 22 21 20 19 18 17 16 bit symbol add023 add022 add021 add020 add019 add018 add017 add016 read/write r/w after reset 0 0 0 0 0 0 0 0 function 31 30 29 28 27 26 25 24 bit symbol add031 add030 add029 add028 add027 add026 add025 add024 read/write r/w after reset 0 0 0 0 0 0 0 0 function 7 6 5 4 3 2 1 0 addreg1 bit symbol add07 add06 add05 ? ? ? ? ? (0xffff_e54c) read/write r/w ? after reset 0 0 0 ? ? ? ? ? function 15 14 13 12 11 10 9 8 bit symbol add015 add014 add13 add012 add011 add010 add09 add08 read/write r/w after reset 0 0 0 0 0 0 0 0 function 23 22 21 20 19 18 17 16 bit symbol add023 add022 add021 add020 add019 add018 add017 add016 read/write r/w after reset 0 0 0 0 0 0 0 0 function 31 30 29 28 27 26 25 24 bit symbol add031 add030 add029 add028 add027 add026 add025 add024 read/write r/w after reset 0 0 0 0 0 0 0 0 function tmp1942cy/cz-346 note: dmac transfer to an address register is not su pported. however, dmac transfer to the substitution data areas allocated in ram is supported. the rom correction function is valid for both cpu access and dmac access.
tmp1942cy/cz 3.18 timer for real-time clock the tmp1942 contains a timer for real - time clock . using the 32. 768 - khz low - frequency clock , the timer implements a time - keeping function by generating interrupts every 0 . 0625 s, 0 . 125 s, 0 . 25 s or 0 . 50 s. the timer for real - time clock can operate in any mode in which low - frequency oscillation is enabled . in addition , a real - time clock interrupt can be used to release the device from a standby mode ( other than stop mode ). when using a real - time clock interrupt ( intrtc ), set the imcgb3 register in the cg block appropriately . 3.18.1 configuration figure 3.18.1 shows a block diagram of the timer for real - time clock . 14-stage binary counter selector interrupt request intrtc rtccr rtccr 2 14 run /clear 2 13 2 12 2 11 fs (32.768 khz) 8-bit accumulator rtcreg figure 3.18.1 block diagram of timer for real-time clock the timer for real - time clock can be controlled using the timer for real - time clock control register ( rtccr ). figure 3.18.2 shows the functions of this register . 7 6 5 4 3 2 1 0 rtccr bit symbol ? ? ? ? rtcrclr rtcsel1 rtcsel0 rtcrun (0xffff_f0a0) read/write ? ? ? ? r/w r/w r/w after reset 0 ? ? ? 0 0 0 0 function must always be set to 0. clears accumulator 0: clear 1: don't care 00: 2 14 /fs 01: 2 13 /fs 10: 2 12 /fs 11: 2 11 /fs 0: stop and clear 1: count interrupt generation cycle (fs = 32.768 khz) 00 0.50 s 01 0.25 s 10 0.125 s 11 0.0625 s figure 3.18.2 timer for real-time clock control register tmp1942cy/cz-347
tmp1942cy/cz the timer for real - time clock has an accumulator which , when set , holds a cumulative count of the timer for real - time clock interrupts which have been generated . if, for example , an interrupt generation cycle of 0 . 5 second is selected , this register can hold a cumulative count for up to 127 . 5 seconds . accumulator 7 6 5 4 3 2 1 0 rtcreg bit symbol rui7 rui6 rui5 rui4 rui3 rui2 rui1 rui0 (0xffff_f0a4) read/write r after reset 0 0 0 0 0 0 0 0 function accumulate count value figure 3.18.3 accumulator of timer for real-time clock each time an intrtc interrupt is generated , the accumulator is incremented after one cycle of the fs clock . the accumulator must be read in slow mode . an instruction for clearing the accumulator is not accepted within one fs clock cycle after the generation of an intrtc interrupt . to clear the accumulator , execute two clear accumulator instructions in slow mode . a ccumulated counter value n fs clock intrtc interrupt n+1 instruction for clearing accumulated counter value not accepted example 1: clearing the accumulator 7 6 5 4 3 210 syscr1 x x 1 ? ? x ? ? select slow mode. rtccr 0 x x x 0 ? ? 1 rtccr 0 x x x 0 ? ? 1 clear accumulator twice. syscr1 x x 0 ? ? x ? ? restore normal mode. example 2: setting up a timer for real-time clock interrupt initial settings 7 6 5 4 3 2 1 0 imcgb3 0 0 1 1 0 0 0 1 imcehl 0 0 0 1 0 x x x set interrupt level. eicrcg 0 0 0 0 0 1 1 1 clear interrupt request for cg block. intclr 0 0 1 1 1 0 1 0 clear interrupt request for intc block. rtccr 0 0 0 0 1 x x 1 start timer counting. intrtc interrupt 7 6 5 4 3 2 1 0 eicrcg 0 0 0 0 0 1 1 1 clear interrupt request for cg block. intclr 0 0 1 1 1 0 1 0 clear interrupt request for intc block. processing end of interrupt note 1: x = don't care note 2: to disable interrupts, set imcehl before setting imcgb3. tmp1942cy/cz-348
tmp1942cy/cz 3.19 watchdog timer (runaway detection timer) the tmp1942 contains a watchdog timer for the purpose of runaway detection . when the cpu starts operating erratically ( runaway ) due to noise or other causes , the watchdog timer ( wdt ) detects this runaway condition to re - establish a normal condition . upon detecting a runaway condition , the watchdog timer notifies the cpu by generating a non - maskable interrupt . also , output from the watchdog timer can be transmitted to a reset input ( internal to the chip ) in order to forcibly reset the device . 3.19.1 configuration figure 3.19.1 shows a block diagram of the watchdog timer . internal reset wdmod wdmod reset watchdog timer control register wdcr q r s 2 21 internal reset wdmod interrupt request intwd f sys /2 selector 2 19 2 17 2 15 internal data bus write b1h write 4eh reset pin reset controller binary counter (22 stages) figure 3.19.1 watchdog timer block diagram tmp1942cy/cz-349
tmp1942cy/cz tmp1942cy/cz-350 the watchdog timer consists of a 22 - stage binary counter clocked by the system clock fsys / 2 . four binary counter outputs are available : 2 15 , 2 17 , 2 19 and 2 21 . any one of these counter outputs can be selected using wdmod < wdtp1 : wdtp0 >, so that when the selected counter output overflows , a watchdog timer interrupt will be generated , as shown in figure 3.19.2 . figure 3.19.2 normal mode also , it is possible to reset the chip itself when the counter output overflows . in this case, the chip is reset for a period of 22 to 29 states as shown in figure 3 . 19 . 3 . when the chip is reset in this way , the watchdog timer is clocked by a clock of fsys , instead of by the afore - mentioned input clock fsys / 2 . the fsys clock is derived by dividing the high - speed oscillator's clock fc by a clock gear of 8 . figure 3.19.3 reset mode note: even when the chip is reset by the watchdog timer, the plloff pin is sampled. thus, the plloff pin must be held at a constant logic level, either high or low. 0 wdt interrupt wdt clear (software) write clear code wdt counter n overflow overflow wdt counter n wdt interrupt 22 to 29 states (8.8~11.6 s @ f c = 40 mhz, f sys = 5 mhz, f sys/2 = 2.5 mhz) internal reset
tmp1942cy/cz 3.19.2 control registers the watchdog timer ( wdt ) can be controlled using two control registers ( wdmod and wdcr). (1) watchdog timer mode register ( wdmod ) a . setting the watchdog timer detection time ( wdtp1 : wdtp0 ) these two bits are used to set the watchdog timer interrupt detection time necessary for detecting a runaway condition . upon a reset , wdmod < wdtp1 : wdtp0 > are initialized to 00. figure 3 . 19 . 4 shows watchdog timer detection times. b . enabling / disabling the watchdog timer ( wdte ) upon a reset , wdmod< wdte > is initialized to 1 , enabling the watchdog timer . to disable the watchdog timer , set this bit to 0 and , at the same time , write the disable code ( b1h ) to the wdcr register . this dual setting ensures that the watchdog timer cannot easily be disabled by a runaway condition . to re - enable the watchdog timer after it has been disabled , simply set the wdmod < wdte > bit to 1 . c . connecting the watchdog timer output to reset ( rescr ) this bit is used to specify whether or not the cpu itself will be reset upon the detection of a runaway condition . upon a reset , wdmod < rescr> is initialized to 0 . when wdmod < rescr> = 0 , the cpu will not be reset by the watchdog timer output . (2) watchdog timer control register ( wdcr) this register controls the watchdog timer by disabling the watchdog timer function and clearing the binary counter . ? disabling the watchdog timer the watchdog timer can be disabled by setting wdmod < wdte > to 0 and then writing the disable code ( b1h ) to the wdcr register . wdmod 0 ? ? ? ? ? ? ? clear wdte to 0. wdcr 1 0 1 1 0 0 0 1 write disable code (b1h). ? enabling the watchdog timer set wdmod < wdte > to 1 . ? clearing the binary counter writing the clear code ( 4eh ) to the wdcr register clears the binary counter and restarts counting . wdcr 0 1 0 0 1 1 1 0 write clear code (4eh). note: writing the disable code (b1h) caus es the binary counter to be cleared. tmp1942cy/cz-351
tmp1942cy/cz 7 6 5 4 3 2 1 0 wdmod bit symbol wdte wdtp1 wdtp0 ? ? i2wdt rescr ? (0xffff_f090) read/write r/w r/w ? ? r/w r/w after reset 1 0 0 ? ? 0 0 0 function controls wdt 1: enable selects wdt detection time 00: 2 16 /f sys 01: 2 18 /f sys 10: 2 20 /f sys 11: 2 22 /f sys i d l e 0: idle 1: operate 1: transmits wdt output to chip's internal reset pin must always be set to 0. controls watchdog timer output 0 ? 1 transmit wdt output to reset watchdog timer detection time @ fc = 32 mhz, fs = 32.768 khz watchdog timer detection time wdmod syscr1 system clock selection syscr1 clock gear value 00 01 10 11 1 (fs) xxx 2.0 s 8.0 s 32.0 s 128.0 s 00 (fc) 2.048 ms 8.192 ms 32.768 ms 131.072 ms 01 (fc/ 2 ) 4.096 ms 16.384 ms 65.536 ms 262.144 ms 10 (fc/ 4 ) 8.192 ms 32.768 ms 131.072 ms 524.288 ms 0 (fc) 11 (fc/ 8 ) 16.384 ms 65.536 ms 262.144 ms 1048.576 ms disables/enables watchdog timer 0 disable 1 enable figure 3.19.4 watchdog timer mode register 7 6 5 4 3 2 1 0 wdcr bit symbol ? (0xffff_f091) read/write w after reset ? function b1h: wdt disable code 4eh: wdt clear code disables or clears wdt b1h disable code 4eh clear code other values ? figure 3.19.5 watchdog timer control register tmp1942cy/cz-352
tmp1942cy/cz 3.19.3 functional description after the detection time which has been set in wdmod < wdt1 : wdt0 >, the watchdog timer generates an interrupt ( intwdt ). the binary counter for the watchdog timer must be cleared to zero by software before an intwdt interrupt can occur . if runaway occurs in the cpu due to noise or other causes , and prevents the cpu from executing the instruction to clear the binary counter , the binary counter will overflow and generate an intwdt interrupt . this interrupt notifies the cpu that it has gone out of control , so that the cpu can restore itself to a normal condition by executing a program to correct the runaway condition . also , output from the watchdog timer can be transmitted to the reset pin or other pins of peripheral devices to address the cpu runway condition . the watchdog timer will start operating as soon as the device has completed its reset sequence . in sleep and stop modes , the watchdog timer is reset and remains idle . if the bus is free ( busak = low ), it will continue to count . in idle mode , the wdmod < i2wdt > setting determines whether the watchdog timer is on or off . before placing the device into idle mode , set wdmod < i2wdt > as required . examples: 1 ) clearing the binary counter 7 6 5 4 3 2 1 0 wdcr 0 1 0 0 1 1 1 0 write clear code (4eh). 2 ) setting the watchdog timer detection time to 2 18 / fsys 7 6 5 4 3 2 1 0 wdmod 1 0 1 ? ? ? ? ? 3 ) disabling the watchdog timer 7 6 5 4 3 2 1 0 wdmod 0 ? ? ? ? ? ? ? clear wdte to 0. wdcr 1 0 1 1 0 0 0 1 write disable code (b1h). tmp1942cy/cz-353
tmp1942cy/cz 4 electrical characteristics 4.1 absolute maximum ratings parameter symbol rating unit v cc3 ? 0.5~4.0 v supply voltage v cc5 ? 0.5~6.0 v v in3 ? 0.5~v cc3 + 0.5 v input voltage v in5 (note) ? 0.5~ v cc5 + 0.5 v low-level output current v ain ? 0.5~ avcc+ 0.5 v varefh ? 0.5~ avcc+ 0.5 v analog input darefh ? 0.5~ davcc+ 0.5 v per pin i ol 5 low-level output current total i ol 80 per pin i oh ?5 high-level output current total i oh ?80 ma power dissipation (ta = 85c) pd 600 mw soldering temperature (10 s) t solder 260 c storage temperature t stg ?65~150 c operating temperature t opr ?40~85 c v cc3 = dv cc3 = av cc =dav cc =cv cc , v cc5 =dv cc51 =dv cc52 v ss =dv ss = av ss = dav ss =cv ss note : portc , portf note: maximum ratings are limiting values of operating and environmental conditions which should not be exceeded under the worst possible conditions. the equipment manufacturer s hould design so that no maximum rating value is exceeded with respect to cu rrent, voltage, power dissipation, temperature, etc. exposure to conditions beyond those listed above may cause permanent damage to the device or affect device reliability, which could increase potential risks of personal injury due to ic blowup and/or burning. the letter x in equations presented in this chapte r represents the cycle period of the fsys clock selected through the programming of the syscr1.sysck bit. the fsys clock may be derived from either the high-speed or low-speed crystal oscillator. the programming of the clock gear function also affects the fsys frequency. all relevant values in this chapter are calculated with the high-speed (fc) system clock (syscr1.sysck=0) and a clock gear factor of 1/fc (syscr1.gear[1:0]=00). tmp1942cy/cz-354
tmp1942cy/cz 4.2 dc electrical characteristics (1/4) ta=-40~85 c parameter symbol condition min typ (note 1) max unit fosc = 5~8mhz fsys = 2.5~32mhz fs = 30~34khz 3.0 pllon (intlv=?h?) fosc = 5~7mhz 2.7 fsys = .5~28mhz fs = 30~34khz plloff (crystal) (intlv=?h?) fosc = 10~20mhz fsys = 1~20mhz fs = 30~34khz (intlv=?l?) fosc = 10~16mhz fsys = 1~16mhz fs = 30~34khz 2.7 fosc = 20~32mhz fsys = 1.25~16mhz fs = 30~34khz = ?0? 3.0 dvcc3 plloff (external clock) fosc = 10~16mhz fsys = 1~16mhz fs = 30~34khz 2.7 3.6 supply voltage davcc=avcc =cvcc=dvcc3 davss=avss = cvss= 0v dvcc5* (note 2) fsys = 1~32mhz fs = 30~34khz 4.5 5.25 v p00~p17(ad0~15) v il 0.6 p20~pb7 ,pd0~pe7 v il1 0.3dvcc3 plloff ,bw0 ,bw1, rstpup , reset , nmi v il2 0.2 dvcc3 pc0~pc7 ,pf0~pf6 v il3 0.3 dvcc5 low-level input voltage x1 v il4 ? 0.3 0.2 dvcc3 p00~p17(ad0~15) v ih 2.0 p20~pb7 ,pd0~pe7 v ih1 0.7dvcc3 plloff ,bw0 ,bw1 , rstpup , reset , nmi v ih2 0.8dvcc3 dvcc3 + 0.3 pc0~pc7 ,pf0~pf6 v ih3 0.7dvcc5 dvcc5 + 0.3 high-level input voltage x1 v ih4 dvcc3 2.7v dvcc5 4.5v 0.8dvcc3 dvcc3 + 0.3 v dvcc3 2.7v low-level output voltage v ol i ol = 1.6ma dvcc5 4.5v 0.45 v oh1 dvcc3 2.7v 2.4 dvcc5 2.7v 2.4 high-level output voltage v oh2 (note3) i oh = ? 400 a 4.2 v dvcc5 4.5v note 1: v cc3 = 3.3 v, v cc5 = 5.0 v, ta = 25c, unless otherwise noted. note 2: dvcc5*:dvcc51,dvcc52 dvcc5*can be used also as 2.7v dvcc5* 3.6v. note 3: portc,portf tmp1942cy/cz-355
tmp1942cy/cz 4.3 dc electrical characteristics (2/4) ta=-40~85 c parameter symbol condition min typ (note ) max unit input leakage current i li 0.0 v in d vccn (n=3,5) 0.02 5 output leakage current i lo 0.2 v in dvccn ? 0.2(n=3,5) 0.05 10 a v stop1 v il2 = 0.2dvcc3 v ih2 = 0.8dvcc3 2.2 3.6 power-down voltage (stop mode, ram backup) v stop2 v il2 = 0.2dvcc5 v ih2 = 0.8dvcc5 v stop1 5.25 v pull-up resistor at reset rrst v cc = 3.3v 0.3v 100 550 k ? pkh1 dvcc3 = 3.3v 0.3v 30 45 100 programmable pull-up resistor p32~p37,p40~p43 key0~keyd pkh2 dvcc5 = 4.5v~5.25v 30 55 100 k ? pin capacitance (except power/ground pins) c io fc = 1mhz 10 pf note: v cc3 = 3.3 v, v cc5 = 5.0 v, ta = 25 c, unless otherwise noted. tmp1942cy/cz-356
tmp1942cy/cz 4.4 dc electrical characteristics (3/4) (1) tmp1942cyue dvcc3=3.3v0.3v , dvcc51= dvcc52 = 3.3v0.3v , ta=-40~85 c parameter symbol condition min typ (note1) max unit normal (note2) gear=1/1 70 90 idle(doze) 22 34 idle(halt) f sys = 32mhz ( f osc = 8mhz , pllon) intlv=?h? 20 30 ma normal (note2) gear=1/1 44 58 idle(doze) 11 15 idle(halt) f sys = 16mhz ( f osc = 16mhz, plloff) intlv=?l? 10 13 ma slow fs = 32.768khz 50 120 a sleep fs = 32.768khz 8 60 a stop i cc dvcc3 = 2.7~3.6v dvcc5 = 2.7~3.6v 1 50 a note1: v cc3 = 3.3 v, v cc5 = 5.0 v, ta = 25c, unless otherwise noted. note2: the measurement co nditions of icc normal cpu:dhrystone(ver.2.1)(there is external memory access) 8bit timer:500khz/50%output3ch,50khz/50%output3ch 16 bit timer:500khz/50%output3ch,50khz/50% output3ch,2ms interval timer6ch,2-phase pulse input counter2ch sio:uart(11.5kbps)1ch,i/o interface mode (50khz)4ch adc:fixed channel, continuous conversion dac:output(0x200)3ch note3: the measurement condi tions of icc slow,icc sleep cpu:equivalent to normal mode timer for real-time clock, 2-pulse input counter, dynamic pull-up mode (16ms cycle, 250us sampling) note4: the supply current flowing through the dvcc3, dv cc5, cvcc, avcc and davcc pins is include in the digital supply current parameter (icc). note5: the supply current flowing through the a/d and d/a c onverter is include in the refarence current parameter (icc normal). tmp1942cy/cz-357
tmp1942cy/cz (2) TMP1942CZUE/xb dvcc3=3.3v0.3v , dvcc51= dvcc52 = 3.3v0.3v , ta=-40~85 c parameter symbol condition min. typ. (note1) max. unit normal (note2) gear=1/1 70 90 idle(doze) 22 34 idle(halt) f sys = 32mhz ( f osc = 8mhz , pllon) intlv=?h? 20 30 ma normal (note2) gear=1/1 40 58 idle(doze) 11 15 idle(halt) f sys = 16mhz ( f osc = 16mhz, plloff) intlv=?l? 10 13 ma slow fs = 32.768khz 50 120 a sleep fs = 32.768khz 8 60 a stop i cc dvcc3 = 2.7~3.6v dvcc5 = 2.7~3.6v 1 50 a note1: v cc3 = 3.3 v, v cc5 = 5.0 v, ta = 25c, unless otherwise noted. note2: the measurement co nditions of icc normal cpu:dhrystone(ver.2.1)(there is external memory access) 8bit timer:500khz/50%output3ch,50khz/50%output3ch 16 bit timer:500khz/50%output3ch,50khz/50% output3ch,2ms interval timer6ch,2-phase pulse input counter2ch sio:uart(11.5kbps)1ch,i/o interface mode (50khz)4ch adc:fixed channel, continuous conversion dac:output(0x200)3ch note3: the measurement condi tions of icc slow,icc sleep cpu:equivalent to normal mode timer for real-time clock, 2-pulse input counter, dynamic pull-up mode (16ms cycle, 250us sampling) note4: the supply current flowing through the dvcc3, dv cc5, cvcc, avcc and davcc pins is include in the digital supply current parameter (icc). note5: the supply current flowing through the a/d and d/a c onverter is include in the refarence current parameter (icc normal). tmp1942cy/cz-358
tmp1942cy/cz 4.5 dc electrical characteristics (4/4) (1) tmp1942cyue dvcc3=3.3v0.3v , dvcc 51= dvcc52 = 5.0v0.25v , ta=-40~85 c parameter symbol condition min typ (note1) max unit f sys = 32mhz ( f osc = 8mhz , pllon) intlv=?h? 70 90 ma normal gear=1/1 f sys = 16mhz ( f osc = 16mhz , plloff) intlv=?l? 44 58 ma slow fs = 32.768khz 50 120 sleep fs = 32.768khz 8 60 a stop i cc dvcc3 = 2.7~3.6v dvcc5 = 4.75~5.25v 1 50 a note1: note1: v cc3 = 3.3 v, v cc5 = 5.0 v, ta = 25c, unless otherwise noted. note2: the measurement conditions of icc normal: please refe r to 4.4 dc electrical characteristics (3/4) note2 and note3. note3: an electroc current to use in cvcc, avcc and davcc is inncluded in dvcc3(icc). note4: an electroc current to use in dv cc51 and dvcc52 is inncluded in dvcc5(icc). (2) TMP1942CZUE/xb dvcc3=3.3v0.3v , dvcc 51= dvcc52 = 5.0v0.25v , ta=-40~85 c parameter symbol condition min typ (note1) max unit f sys = 32mhz ( f osc = 8mhz , pllon) intlv=?h? 70 90 ma normal gear=1/1 f sys = 16mhz ( f osc = 16mhz , plloff) intlv=?l? 44 58 ma slow fs = 32.768khz 50 120 sleep fs = 32.768khz 8 60 a stop i cc dvcc3 = 2.7~3.6v dvcc5 = 4.75~5.25v 1 50 a note1: note1: v cc3 = 3.3 v, v cc5 = 5.0 v, ta = 25c, unless otherwise noted. note2: the measurement conditions of icc normal: please refe r to 4.4 dc electrical characteristics (3/4) note2 and note3. note3: an electroc current to use in cvcc, avcc and davcc is inncluded in dvcc3(icc). note4: an electroc current to use in dv cc51 and dvcc52 is inncluded in dvcc5(icc). tmp1942cy/cz-359
tmp1942cy/cz 4.6 10bit a/d converter electrical characteristics (1) tmp1942cyue ta=-40~85 c parameter symbol condition min typ max unit 2.7 3.6 reference ( + ) vrefh avcc ? 0.3 avcc avcc+ 0.3 v reference ( ? ) vrefl avss avss avss + 0.2 v analog input vain vrefl vrefh v conversion dvcc3 = avcc = vrefh = 3.3v 0.3v dvss = avss = vrefl 2 2.5 ma reference current no conversion iref dvcc3 = avcc = vrefh = 2.7~3.6v dvss = avss = vrefl 0.02 5 a analog input capacitance ? 20 pf analog input impedance ? 5 k ? inl error ? 2. 5 lsb dnl error ? 2 lsb offset error ? 4 lsb gain error ? dvcc3 = avcc = vrefh = 3.3v 0.3v dvss = avss = vrefl ain resistance<5 ? ain load capacitance<50pf avcc load capacitance 10 f vrefh load capacitance 10 f conversion time 2 s (scan mode) conversion time 4 s (single mode) 4 lsb note1: 1lsb = (vrefh ? vrefl) / 1024[v] note2: the a/d converter must be stopped when opera ting the tmp1942 with the low-speed clock (fs). note3: the supply current flowing through the avcc pi n is included in the digital supply current parameter (icc). tmp1942cy/cz-360
tmp1942cy/cz (2) TMP1942CZUE/xb ta=-40~85 c parameter symbol condition min typ max unit 2.7 3.6 reference ( + ) vrefh avcc ? 0.3 avcc avcc+ 0.3 v reference( ? ) vrefl avss avss avss + 0.2 v analog input vain vrefl vrefh v conversion dvcc3 = avcc = vrefh = 3.3v 0.3v dvss = avss = vrefl 2.2 2.85 ma reference current no conversion iref dvcc3 = avcc = vrefh = 2.7~3.6v dvss = avss = vrefl 0.02 5 a analog input capacitance ? 20 pf analog input impedance ? 5 k ? inl error ? 2. 5 lsb dnl error ? 2 lsb offset error ? 4 lsb gain error ? dvcc3 = avcc = vrefh = 3.3v 0.3v dvss = avss = vrefl ain resistance<5 ? ain load capacitance<50pf avcc load capacitance 10 f vrefh load capacitance 10 f conversion time 2 s (scan mode) conversion time 4 s (single mode) 4 lsb note1: 1lsb = (vrefh ? vrefl) / 1024[v] note2: the a/d converter must be stopped when opera ting the tmp1942 with the low-speed clock (fs). note3: the supply current flowing through the avcc pi n is included in the digital supply current parameter (icc). tmp1942cy/cz-361
tmp1942cy/cz 4.7 10bit d/a converter electrical characteristics ta=-40~85 c parameter symbol condition min typ max unit 2.7 3.6 v reference ( + ) darefh davcc ? 0.3 davcc davcc+0.3 v = 1 dvcc3 = davcc = darefh = 3.3v 0.3v dvss = davss 0.6 1 ma reference current = 0 idref dvcc3 = davcc = darefh = 2.7~3.6v dvss = davss 0.02 5 a output current idaout dvcc3 = davcc = darefh = 2.7~3.6v dvss = davss 1 1.5 ma outpu voltage range daout dvcc3 = davcc = darefh = 2.7~3.6v dvss = davss davss+0.3 davcc-0.3 v gain error ? dvcc3 = davcc = darefh = 3.3v 0.3v dvss = davss 1 3 lsb note1: 1lsb = (darefh ? davss) / 1024[v] note2: the d/a converter must be stopped when opera ting the tmp1942 with the low-speed clock (fs). note3: the supply current flowing through the da vcc pin is included in the digital supply current parameter (icc). note4: idref electoric current value is an electoric current value when i moved three d/a converter. tmp1942cy/cz-362
tmp1942cy/cz 4.8 ac electrical characteristics (1) v cc = 3.0 ~ 3.6 v, ta = 0~70 c, ale = 0.5 clock cycle (recommended when t sys is 50 ns or longer) equation 20 mhz(fsys) * no. parameter symbol min max min max unit 1 system clock period (x) t sys 31.25 33333 50 ns 2 a0?a15 valid to ale low t al 0.4x ? 12 8 ns 3 a0?a15 hold after ale low t la 0.4x ? 8 12 ns 4 ale pulse width high t ll 0.4x ? 6 14 ns 5 ale low to rd or wr asserted t lc 0.4x ?8 12 ns 6 rd or wr negated to ale high t cl x ? 15 35 ns 7 a0?a15 valid to rd or wr asserted t acl x ? 20 30 ns 8 a0?a23 valid to rd or wr asserted t ach x ? 20 30 ns 9 a0?a23 hold after rd or wr negated t car x ? 15 35 ns 10 a0?a15 valid to d0?d15 data in t adl x (2 + w) ? 42 58 ns 11 a0?a23 hold after rd or wr negated t adh x (2 + w) ? 42 58 ns 12 rd asserted to d0?d15 data in t rd x (1 + w) ? 28 22 ns 13 rd width low t rr x (1 + w) ? 10 40 ns 14 d0?d15 hold after rd negated t hr 0 0 ns 15 rd negated to next a0?a15 output t rae x ? 15 35 ns 16 wr width low t ww x (1 + w) ? 10 40 ns 17 d0?d15 valid to wr negated t dw x (1 + w) ? 18 32 ns 18 d0?d15 hold after wr negated t wd x ? 15 35 ns 19 a0?a23 valid to wait input t awh 1.5x ? 30 45 ns 20 a0?a15 valid to wait input t awl 1.5x ? 30 45 ns 21 wait hold after rd or wr asserted t cw (0.5 + n ? 1) x +2 (0.5 + n) x ? 17 27 58 ns * wait = 0 ac measurement conditions: ? output levels: high = 2.4 v, low = 0.45 v, cl = 30 pf ? input levels: high = 2 v, low = 0.6 v w: number of wait-state cycles inserted (0 to 7 for programmed wait insertion) n : value of n for (1 + n) wait insertion tmp1942cy/cz-363
tmp1942cy/cz (2)v cc = 3.0 ~ 3.6 v, ta = 0 ~ 70 c, ale = 1.5 clock cycles equation 32 mhz(fsys) * no. parameter symbo l min max min max unit 1 system clock period (x) t sys 31.25 33333 ns 2 a0?a15 valid to ale low t al 1.4x ? 12 31 ns 3 a0?a15 hold after ale low t la 0.4x ? 8 4 ns 4 ale pulse width high t ll 1.4x ? 6 37 ns 5 ale low to rd or wr asserted t lc 0.4x ? 8 4 ns 6 rd or wr negated to ale high t cl x ? 15 16 ns 7 a0?a15 valid to rd or wr asserted t acl 2x ? 20 42 ns 8 a0?a23 valid to rd or wr asserted t ach 2x ? 20 42 ns 9 a0?a23 hold after rd or wr negated t ca x ? 15 16 ns 10 a0?a15 valid to d0?d15 data in t adl x (3 + w) ? 42 51 ns 11 a0?a23 valid to d0?d15 data in t adh x (3 + w) ? 42 51 ns 12 rd asserted to d0?d15 data in t rd x (1 + w) ? 28 3 ns 13 rd width low t rr x (1 + w) ? 10 21 ns 14 d0?d15 hold after rd negated t hr 0 0 ns 15 rd negated to next a0?a15 output t rae x ? 15 16 ns 16 wr width low t ww x (1 + w) ? 10 21 ns 17 d0?d15 valid to wr negated t dw x (1 + w) ? 18 13 ns 18 d0?d15 hold after wr negated t wd x ? 15 16 ns 19 a0?a23 valid to wait input t awh 2.5x ? 30 48 ns 20 a0?a15 valid to wait input t awl 2.5x ? 30 48 ns 21 wait hold after rd or wr asserted t cw (0.5 + n ? 1) x + 2 (0.5 + n) x ? 17 18 29 ns * wait = 0 ac measurement conditions: ? output levels: high = 2.4 v, low = 0.45 v, cl = 30 pf ? input levels: high = 2 v, low = 0.6 v w: number of wait-state cycles inserted (0 to 7 for programmed wait insertion) n : value of n for (1 + n) wait insertion tmp1942cy/cz-364
tmp1942cy/cz (1) read cycle timing (ale = 1.5,no-wait) t rae t rr t car t hr t adh t adl t la d0 15 t al t cl t ll ale internal clk ad0~15 rd cs0 ~ 3 w/ r s0 s1 s2 s3 s0 a0 15 t acl t ach t lc t rd ad16~23 4clk/1bus cycle tmp1942cy/cz-365
tmp1942cy/cz (2) read cycle timing (ale = 1.5,1-wait (internal wait) ) t car t rr t hr t adh t adl t la d0 15 t al t cl t ll ale internal clk ad0~15 rd cs0 ~ 3 w/ r s0 s1 s2 s3 s0 a0 15 t acl t ach t lc t rd a16~23 5clk/1bus cycle w1 t rae tmp1942cy/cz-366
tmp1942cy/cz (3) read cycle timing (ale = 1.5.2-wait (external n = 1) ) t aw l/h ale internal clk ad0~15 rd cs0 ~ 3 w/ r ad16~23 6clk/1bus cycle wait d0 15 s1 w s2 s3 s0 a0 15 w t cw note: if t awh and/or t awl cannot be satisified, a bus cycle must be initiated with the wait pin asserted. tmp1942cy/cz-367
tmp1942cy/cz (4) write cycle timing (ale = 1.5,no-wait) t ww t car t dw t la d0 15 t al t cl t ll ale ad0~15 wr , hwr cs0 ~ 3 w/r a0 15 t acl t ach t lc ad16~23 4clk/1bus cycle t wd internal clk tmp1942cy/cz-368
tmp1942cy/cz sio timing (1) i/o interface mode in the tables below, the letter x represents the fsys cycle period, which varies, depending on the programming of the clock gear function. 1. sclk input mode(sio0,sio1,sio3,sio4) equation 20 mhz 32 mhz parameter sym bol min max min max min max unit sclk period t scy 16x 800 500 ns txd data to sclk rise or fall t oss (t scy /2) ? 5x ? 23 127 72 ns txd data hold after sclk rise or fall * t ohs (t scy /2) + 3x 550 343 ns rxd data valid to sclk rise or fall * t srd 2x + 8 108 70 ns rxd data hold after sclk rise or fall * t hsr 0 0 0 ns sio5(dvcc51=2.7v~3.6v or 4.5v~5.25v) equation 20 mhz 32 mhz parameter sym bol min max min max min max unit sclk period t scy 16x 800 500 ns txd data to sclk rise or fall t oss (t scy /2) ? 5x ? 23 127 72 ns txd data hold after sclk rise or fall * t ohs (t scy /2) + 3x 550 343 ns rxd data valid to sclk rise or fall * t srd 2x + 8 108 70 ns rxd data hold after sck rise t hsr 0 0 0 ns note *: sclk rise or fall: measured relative to the programmed active edge of sclk. tmp1942cy/cz-369
tmp1942cy/cz 2. sclk output mode (sio0,sio1,sio3,sio4) equation 20 mhz 32 mhz parameter sym bol min max min max min max unit sclk period (programmable) t scy 16x 800 500 ns txd data to sclk rise t oss (t scy /2) ? 15 385 235 ns txd data hold after sclk rise t ohs (t scy /2) ? 15 385 235 ns rxd data valid to sck rise t srd x + 23 73 54 ns rxd data hold after sck rise t hsr 0 0 0 ns (sio5 dvcc51=2.7v~3.6v or 4.5v~5.25v) equation 20 mhz 32 mhz parameter sym bol min max min max min max unit sclk period (programmable) t scy 16x 800 500 ns txd data to sclk rise t oss (t scy /2) ? 15 385 235 ns txd data hold after sclk rise t ohs (t scy /2) ? 15 385 235 ns rxd data valid to sck rise t srd x + 23 73 54 ns rxd data hold after sck rise t hsr 0 0 0 ns output data txd input data rxd sclk sck output mode / active-high scl 0 valid t oss t scy t ohs 1 2 3 t srd t hsr 0 1 2 3 valid valid valid sclk active-low sck input mode tmp1942cy/cz-370
tmp1942cy/cz tmp1942cy/cz-371 4.9 sbi timing (1) i2c mode in the table below, the letters x and t represent the fsys and t0 cycle periods, respectively. the letter n denotes the value of n programmed into the sck[2:0] (scl output frequency select) field in the sbi0cr1. equation standard mode fsys = 8 mhz, n = 4 fast mode fsys = 32 mhz, n = 4 parameter symbol min max min max min max unit scl clock frequency t scl 0 0 100 0 400 khz hold time for start condition t hd:sta 4.0 0.6 s low period of the scl clock (note 1) t low 4.7 1.3 s scl clock high width t high 4.0 0.6 s setup time for a repeated start condition t su;sta software (note 5) 4.7 0.6 s data hold time(input)(note3,4) t hd;dat 0 0 s data setup time t su;dat 250 100 ns setup time for stop condition t su;sto 4.0 0.6 s bus free time between stop and start conditions t buf software (note 5) 4.7 1.3 s note1: scl clock low width (output) is calculated with (2 (n ? 1) + 4)t. standard mode: 6 sec @ typ (fsys = 8 mhz, n = 4) fast mode: 1.5 sec @ typ (fsys = 32 mhz, n = 4) note2: scl clock high width (output) is caluculated with (2 (n ? 1))t. standard mode: 4 sec @ typ (fsys = 8 mhz, n = 4) fast mode: 1 sec @ typ (fsys = 32 mhz, n = 4) note3: the output data hold time is equal to 12x. note4: the philips i2c-bus specification states that a device must internally provide a hold time of at least 300 ns for the sda signal to bridge t he undefined region of the fall edge of scl. however,tmp1942cy/cz sbi does not satisfy this requirement. also, the output buffer for scl does not incorporate slope control of the falli ng edges; therefore, the equipment manufacturer should design so that the input data hold time show n in the table is satisfied, including tr/tf of the scl and sda lines. note5: software-dependent. sda scl t low t hd;sta t scl t high t r t su;dat t hd;dat t su;sta t su;sto t buf s: start condition sr: repeated start condition p; stop condition t f s sr p note6: to operate the sbi in i2c fast mode, t he fysy frequency must be no less than 20 mhz. to operate the sbi in i2c standard mode, the fy sy fewquency must be no less than 4 mhz.
tmp1942cy/cz (2) clock-synchronous 8-bit sio mode in the tables below, the letters x and t represent the fsys and t0 cycle periods, respectively. the letter n denotes the value of n programmed into the sck[2:0] (scl output frequency select) field in the sbi0cr1. the electrical specifications below are for an sck signal with a 50% duty cycle. 3. sck input mode (dvcc51=2.7v~3.6v or 4.5v~5.25v) equation 32 mhz parameter symbol min max min max unit sck period t scy 16x 500 ns so data to sck rise t oss (t scy /2) ? (6x + 30) 34 ns so data hold after sck rise t ohs (t scy /2) + 4x 374 ns si data valid to sck rise t srd 0 0 ns si data hold after sck rise t hsr 4x + 10 134 ns 4. sck output mode (dvcc51=2.7v~3.6v or 4.5v~5.25v) equation 32 mhz parameter symbol min max min max unit sck period (programmable) t scy 2 n /t 1000 ns so data to sck rise t oss (t scy /2) ? 20 480 ns so data hold after sck rise t ohs (t scy /2) ? 20 480 ns si data valid to sck rise t srd 2x + 30 92 ns si data hold after sck rise t hsr 0 0 ns output data txd input data txd sclk 0 valid t oss t scy t ohs 1 2 3 t srd t hsr 0 1 2 3 valid valid valid tmp1942cy/cz-372
tmp1942cy/cz 4.10 event counters in the table below, the letter x represents the fsys cycle period. equation 32 mhz parameter symbol min max min max unit clock low pulse width t vckl 2x + 100 163 ns clock high pulse width t vckh 2x + 100 163 ns 4.11 timer capture in the table below, the letter x represents the fsys cycle period equation 32mhz parameter symbol min max min max unit low pulse width t cpl 2x + 100 163 ns high pulse width t cph 2x + 100 163 ns 4.12 general interrupts (int0 to inta) in the table below, the letter x represents the fsys cycle period equation 32 mhz parameter symbol min max min max unit low pulse width for int0?inta t intal x + 100 132 ns high pulse width for int0?inta t intah x + 100 132 ns 4.13 nmi and stop/sleep wake-up interrupts equation 32 mhz parameter symbol min max min max unit low pulse width for nmi and int0?int4 t intbl 100 100 ns high pulse width for int0?int4 t intbh 100 100 ns 4.14 scout pin equation 32 mhz parameter symbol min max min max unit scout high pulse width t sch 0.5t ? 5 10.6 ns scout low pulse width t scl 0.5t ? 5 10.6 ns note: in the above table, the letter t repres ents the cycle period of the scout output clock. t sch t scl scout tmp1942cy/cz-373
tmp1942cy/cz 4.15 bus request and bus acknowledge signals t aba (note1) busrq a le a0~a23, rd , wr busak cs0 ~ cs3 , w/ r, hwr a d0~ad15 t baa (note2) (note2) equation 32 mhz parameter symbol min max min max unit bus float to busak asserted t aba 0 80 0 80 ns bus float after busak negated t baa 0 80 0 80 ns note 1: if the current bus cycle has not termin ated due to wait-state insertion, the tmp1941af does not respond to busrq until the wait state ends. note 2: this broken lines indicate that output buffers are disabled, not that the signals are at indeterminate states. the pin holds the last logic value present at that pin before the bus is relinquished. this is dynamically accomplis hed through external load capacitances. the equipment manufacturer may maintain the bus at a predefined state by means of off-chip resistors, but he or she should design, considering the time (determined by the cr constant) it takes for a signal to reach a desired state. the on-chip, integrated programmable pullup/pulldown resistors remain active, depending on internal signal states. tmp1942cy/cz-374
tmp1942cy/cz tmp1942cy/cz-375 4.16 kwup pull-up register inactive equation 32 mhz parameter symbol min max min max unit low pulse width for key0~d tky tbl 100 100 ns high pulse width for key0~d tky tbh 100 100 ns static pull-up equation 32 mhz parameter symbol min max min max unit low pulse width for key0~d tky tbl 100 100 ns dynamic pull-up equation 32 mhz parameter symbol min max min max unit low pulse width for key0~d tky tbl t2+100 t2+100 ns t2: dynamic pull-up frequency 4.17 2-phase input pulse counter mode equation 32 mhz parameter symbol min max min max unit 2-phase input pulse cycle tdcyc 8y 250 s 2-phase input set up tabs y+20 31.27 s 2-phase input hold tabh y+20 31.27 s y:sampling clock(fs or fsys/2) a b 4.18 adtrg input equation 32 mhz parameter symbol min max min max unit adtrg low level pulse width tad l fsysy/2+20 51.25 ns adtrg high level pulse interval tadh fsysy/2+20 51.25 ns tabs tabh tdc y c
tmp1942cy/cz 5. i/o register summary the internal i/o registers occupy 8-kbyte addresses from ffffe000h through ffffffffh. (1) i/o ports (2) watchdog timer (wdt) (3) real-time clock (rtc) (4) 8-bit timer (5) 16-bit timer (6) uart/serial i/o 0/1 (uart/sio) (7) i2cbus/serial i/o (i2c/sio) (8) uart/serial i/o 3/4/5 (uart/sio) (9) 10-bit a/d converter (adc) (10) 10-bit d/a converter (dac) (11) key on waik up (kwup) (12) interrupt controller (intc) (13) dma controller (dmac) (14) chip select (cs)/wait controller (15) clock generator (cg) (16) flash (17) rom correction mnemonic address register name 7 6 1 0 bit symbol read/write reset value function table organization access r/w : read/write. the user can read and write the register bit. r : read omly. w : write only. w * : the user can read and write the register bit, but a read always returns a value of 1. tmp1942cy/cz-376
tmp1942cy/cz [1] i/o port address mnemonic address mnemonic address mnemonic fffff000h p0 fffff010h fffff020h p4cr 1h p1 1h 1h p4fc 2h p0cr 2h p2 2h 3h 3h 3h 4h p1cr 4h p2cr 4h 5h p1fc 5h p2fc 5h 6h 6h 6h 7h 7h 7h 8h 8h p3 8h 9h 9h 9h ah ah p3cr ah bh bh p3fc bh ch ch ch dh dh dh eh eh p4 eh fh fh fh address mnemonic address mnemonic address mnemonic ffff040h p5 fffff050h pa fffff060h pe 1h p6 1h pb 1h pf 2h 2h pacr 2h pecr 3h p5fc 3h pafc 3h pefc 4h 4h pbcr 4h pfcr 5h p6fc 5h pbfc 5h pffc 6h 6h 6h peode 7h 7h 7h pfode 8h 8h pc 8h 9h 9h pd 9h ah ah pccr ah bh bh pcfc bh ch p9 ch pdcr ch reserved dh dh pdfc1 dh reserved eh p9cr eh pdfc2 eh reserved fh p9fc fh pdode fh reserved [2] wdt [3] rtc address mnemonic address mnemonic fffff090h wdmod fffff0a0h rtccr 1h wdcr 1h 2h 2h 3h 3h 4h 4h rtcreg 5h 5h 6h 6h 7h 7h 8h 8h 9h 9h ah ah bh bh ch ch dh dh eh eh fh fh tmp1942cy/cz-377
tmp1942cy/cz [4] 8 bit timers address mnemonic address mnemonic address mnemonic fffff100h ta01run fffff110h ta45run fffff120h ta89run 1h 1h 1h 2h ta0reg 2h ta4reg 2h ta8reg 3h ta1reg 3h ta5reg 3h ta9reg 4h ta01mod 4h ta45mod 4h ta89mod 5h ta1ffcr 5h ta5ffcr 5h ta9ffcr 6h 6h 6h 7h 7h 7h 8h ta23run 8h ta67run 8h taabrun 9h 9h 9h ah ta2reg ah ta6reg ah taareg bh ta3reg bh ta7reg bh tabreg ch ta23mod ch ta67mod ch taabmod dh ta3ffcr dh ta7ffcr dh tabffcr eh eh eh fh fh fh [5] 16 bit timers address mnemonic address mnemonic address mnemonic address mnemonic fffff1 40h tb0run fffff150h tb1run fffff160h tb2run fffff170h tb3run 1h 1h 1h 1h 2h tb0mod 2h tb1mod 2h tb2mod 2h tb3mod 3h tb0ffcr 3h tb1ffcr 3h tb2ffcr 3h tb3ffcr 4h tb0st 4h tb1st 4h tb2st 4h tb3st 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h tb0rg0l 8h tb1rg0l 8h tb2rg0l 8h tb3rg0l 9h tb0rg0h 9h tb1rg0h 9h tb2rg0h 9h tb3rg0h ah tb0rg1l ah tb1rg1l ah tb2rg1l ah tb3rg1l bh tb0rg1h bh tb1rg1h bh tb2rg1h bh tb3rg1h ch tb0cp0l ch tb1cp0l ch tb2cp0l ch tb3cp0l dh tb0cp0h dh tb1cp0h dh tb2cp0h dh tb3cp0h eh tb0cp1l eh tb1cp1l eh tb2cp1l eh tb3cp1l fh tb0cp1h fh tb1cp1h fh tb2cp1h fh tb3cp1h address mnemonic address mnemonic address mnemonic address mnemonic fffff180h tb4run fffff190h tb5run fffff1a0h tb6run fffff1b0h tb7run 1h 1h 1h 1h 2h tb4mod 2h tb5mod 2h tb6mod 2h tb7mod 3h tb4ffcr 3h tb5ffcr 3h tb6ffcr 3h tb7ffcr 4h tb4st 4h tb5st 4h tb6st 4h tb7st 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h tb4rg0l 8h tb5rg0l 8h tb6rg0l 8h tb7rg0l 9h tb4rg0h 9h tb5rg0h 9h tb6rg0h 9h tb7rg0h ah tb4rg1l ah tb5rg1l ah tb6rg1l ah tb7rg1l bh tb4rg1h bh tb 5rg1h bh tb6rg1h bh tb7rg1h ch tb4cp0l ch tb5cp0l ch tb6cp0l ch tb7cp0l dh tb4cp0h dh tb5cp0h dh tb6cp0h dh tb7cp0h eh tb4cp1l eh tb5cp1l eh tb6cp1l eh tb7cp1l fh tb4cp1h fh tb5cp1h fh tb6cp1h fh tb7cp1h tmp1942cy/cz-378
tmp1942cy/cz address mnemonic address mnemonic address mnemonic address mnemonic fffff1c0h tb8run fffff1d0h tb9run fffff1e0h tbarun fffff1f0h tbbrun 1h 1h 1h 1h 2h tb8mod 2h tb9mod 2h tbamod 2h tbbmod 3h reserved 3h reserved 3h reserved 3h reserved 4h tb8st 4h tb9st 4h tbast 4h tbbst 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h tb8rg0l 8h tb9rg0l 8h tbarg0l 8h tbbrg0l 9h tb8rg0h 9h tb9rg0h 9h tbarg0h 9h tbbrg0h ah tb8rg1l ah tb9rg1l ah tbarg1l ah tbbrg1l bh tb8rg1h bh tb9rg1h bh tbarg1h bh tbbrg1h ch tb8cp0l ch tb9cp0l ch tbacp0l ch tbbcp0l dh tb8cp0h dh tb9cp0h dh tbacp0h dh tbbcp0h eh tb8cp1l eh tb9cp1l eh tbacp1l eh tbbcp1l fh tb8cp1h fh tb9cp1h fh tbacp1h fh tbbcp1h address mnemonic address mnemonic fffff200h tbcrun fffff210h tbdrun 1h 1h 2h tbcmod 2h tbdmod 3h reserved 3h reserved 4h tbcst 4h tbdst 5h 5h 6h 6h 7h 7h 8h tbcrg0l 8h tbdrg0l 9h tbcrg0h 9h tbdrg0h ah tbcrg1l ah tbdrg1l bh tbcrg1h bh tbdrg1h ch tbccp0l ch tbdcp0l dh tbccp0h dh tbdcp0h eh tbccp1l eh tbdcp1l fh tbccp1h fh tbdcp1h [6] uart/sio 0/1 [7] i2cbus/sio [8] uart/sio 3/4 uart/sio 5 address mnemonic address mnemonic address mnemonic address mnemonic fffff230h sc0buf fffff240h sbi0cr1 fffff280h sc3buf fffff290h sc5buf 1h sc0cr 1h sbi0dbr 1h sc3cr 1h sc5cr 2h sc0mod0 2h i2c0ar 2h sc3mod0 2h sc5mod0 3h br0cr 3h sbi0cr2/sr 3h br3cr 3h br5cr 4h br0add 4h sbi0br0 4h br3add 4h br5add 5h sc0mod1 5h (sbi0br1) 5h sc3mod1 5h sc5mod1 6h sc0mod2 6h 6h sc3mod2 6h sc5mod2 7h 7h 7h 7h 8h sc1buf 8h 8h sc4buf 8h 9h sc1cr 9h 9h sc4cr 9h ah sc1mod0 ah ah sc4mod0 ah bh br1cr bh bh br4cr bh ch br1add ch ch br4add ch dh sc1mod1 dh dh sc4mod1 dh eh sc1mod2 eh eh sc4mod2 eh fh fh fh fh tmp1942cy/cz-379
tmp1942cy/cz [9] 10 bitadc address mnemonic address mnemonic fffff300h adreg08l fffff310h adregspl 1h adreg08h 1h adregsph 2h adreg19l 2h 3h adreg19h 3h 4h adreg2al 4h adcoml 5h adreg2ah 5h adcomh 6h adreg3bl 6h 7h adreg3bh 7h 8h adreg4cl 8h admod0 9h adreg4ch 9h admod1 ah adreg5dl ah admod2 bh adreg5dh bh admod3 ch adreg6el ch admod4 dh adreg6eh dh eh adreg7fl eh fh adreg7fh fh adclk [10] 10bit dac address mnemonic fffff340h dareg0l 1h dareg0h 2h daccnt0 3h 4h dareg1l 5h dareg1h 6h daccnt1 7h 8h dareg2l 9h dareg2h ah daccnt2 bh ch dh eh fh [11] kwup [12] intbcde address mnemonic address mnemonic address mnemonic address mnemonic fffff360h kwupst0 fffff370h kwupclr fffff 380h intbst 1h kwupst1 1h kwupcnt 1h intcst 2h kwupst2 2h reserved 2h intdst 3h kwupst3 3h 3h intest 4h kwupst4 4h 4h intflg 5h kwupst5 5h 5h 6h kwupst6 6h 6h 7h kwupst7 7h 7h 8h kwupst8 8h 8h 9h kwupst9 9h 9h ah kwupsta ah ah bh kwupstb bh bh ch kwupstc ch ch dh kwupstd dh dh eh eh eh fh fh fh tmp1942cy/cz-380
tmp1942cy/cz [13] intc address mnemonic address mnemonic address mnemonic address mnemonic ffffe000h imc0 ffffe010h imc4 ffffe020h imc8 ffffe030h imcc 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h imc1 4h imc5 4h imc9 4h imcd 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h imc2 8h imc6 8h imca 8h imce 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch imc3 ch imc7 ch imcb ch imcf dh dh dh dh eh eh eh eh fh fh fh fh address mnemonic address mnemonic address mnemonic address mnemonic ffffe040h ivr ffffe050h ffffe060h intclr ffffe070h 1h 1h 1h 1h 2h ivr 2h 2h 2h 3h 3h 3h 3h 4h 4h 4h 4h 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h 8h 8h 8h 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch ch ch ch dh dh dh dh eh eh eh eh fh fh fh fh tmp1942cy/cz-381
tmp1942cy/cz [14] damc address mnemonic address mnemonic address mnemonic address mnemonic ffffe200h ccr0 ffffe210h bcr0 ffffe220h ccr1 ffffe230h bcr1 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h csr0 4h 4h csr1 4h ncr1 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h sar0 8h dtcr0 8h sar1 8h dtcr1 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch dar0 ch ch dar1 ch dh dh dh dh eh eh eh eh fh fh fh fh address mnemonic address mnemonic address mnemonic address mnemonic ffffe240h ccr2 ffffe250h bcr2 ffffe260h ccr3 ffffe270h bcr3 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h csr2 4h ncr2 4h csr3 4h ncr3 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h sar2 8h dtcr2 8h sar3 8h dtcr3 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch dar2 ch ch dar3 ch dh dh dh dh eh eh eh eh fh fh fh fh address mnemonic address mnemonic address mnemonic address mnemonic ffffe280h dcr ffffe290h ffffe2a0h ffffe2b0h 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h 4h 4h 4h 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h 8h 8h 8h 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch dhr ch ch ch dh dh dh dh eh eh eh eh fh fh fh fh tmp1942cy/cz-382
tmp1942cy/cz [15] cs/wait controller address mnemonic address mnemonic address mnemonic address mnemonic ffffe400h bma0 ffffe410h ffffe480h b01cs ffffe490h 1h 1h 1h 1h 2h 2h 2h 2h 3h 3h 3h 3h 4h bma1 4h 4h b23cs 4h 5h 5h 5h 5h 6h 6h 6h 6h 7h 7h 7h 7h 8h bma2 8h 8h bexcs 8h 9h 9h 9h 9h ah ah ah ah bh bh bh bh ch bma3 ch ch ch dh dh dh dh eh eh eh eh fh fh fh fh [16] cg address mnemonic address mnemonic address mnemonic address mnemonic ffffee00h syscr0 ffffee10h imcga0 ffffee20h eicrcg ffffee40h reserved 1h syscr1 1h 1h reserved 1h reserved 2h syscr2 2h 2h reserved 2h reserved 3h syscr3 3h 3h reserved 3h reserved 4h adcck 4h imcgb0 4h 4h reserved 5h 5h 5h 5h reserved 6h 6h 6h 6h reserved 7h 7h 7h 7h reserved 8h 8h reserved 8h 8h reserved 9h 9h reserved 9h 9h reserved ah ah reserved ah ah reserved bh bh reserved bh bh reserved ch ch ch ch dh dh dh dh eh eh eh eh fh fh fh fh [17] flash(flash only./access to fl ash is not possible with dma.) address mnemonic address mnemonic ffffe510h seqmod ffffe520h flcs 1h 1h 2h 2h 3h 3h 4h seqcnt 4h 5h 5h 6h 6h 7h 7h 8h 8h 9h 9h ah ah bh bh ch ch dh dh eh eh fh fh tmp1942cy/cz-383
tmp1942cy/cz [18] rom correction(access to flash is not possible with dma.) address mnemonic ffffe540h addreg0 1h 2h 3h 4h addreg1 5h 6h 7h 8h addreg2 9h ah bh ch addreg3 dh eh fh tmp1942cy/cz-384
tmp1942cy/cz 6. jtag interface the tmp1942fdxb/cyxb processor provides a boundary-scan interface that is compatible with joint test action group (jtag) specifications, using the industry-standard jtag protocol (ieee standard 1149.1/d6). this chapter describes that interface, including descriptio ns of boundary scanning, the pins and signals used by the interface, and the test access port (tap). 6.1 what boundary scanning is with the evolution of ever-denser integrated circuits (ics), surface-mounted devices, double-sided component mounting on printed-circuit boards (pcbs), and buried vias, in-circuit tests that depend upon making physical contact with internal board and chip connections have become more and more difficult to use. the greater complexity of ics has also meant that tests to fully exercise these chips have become much larger and more difficult to write. one solution to this difficulty has been the development of boundary-scan circuits. a boundary-scan circuit is a series of shift register cells placed between each pin and the internal circuitry of the ic to which the pin is connected, as shown in figure 6.1 .1. normally, these boundary-scan cells ar e bypassed; when the ic enters test mode, however, the scan cells can be directed by the test program to pass data along the shift register path and perform various diagnostic tests. to accomplish this, the tests use the four signals described in the next section: tdi, tdo , tms , tck, and trst . integrated circuit ic package pin boundary-scan cells figure 6.1.1 jtag boundary-scan cells tmp1942cy/cz-385
tmp1942cy/cz tmp1942cy/cz-386 6.2 signal summary the jtag interface signals are listed below and shown in figure 6.2 .1. ? tdi jtag serial data in ? tdo jtag serial data out ? tms jtag test mode select ? tck jtag serial clock input ? trst jtag test reset input figure 6.2.1 jtag interf ace signals and registers the jtag boundary-scan mechanism (referred to in this chapter as jtag mechanism) allows testing of the connections between the processor, the printed circuit board to which it is attached, and the other components on the circuit board. the jtag mechanism does not provide any capability for testing the processor itself. 30 instruction register tap controller 0 bypass register 0 114 boundary-scan register jtdi pin jtd0 pin jtms pin jtck pin trst pin
tmp1942cy/cz 6.3 jtag controller and registers the processor contains the following jtag controller and registers: ? instruction register ? boundary-scan register ? bypass register ? id code register ? test access port (tap) controller the processor executes the standard jtag extest operation associated with external test functionality testing. the basic operation of jtag is for the tap controller state machine to monitor the jtms input signal. when it occurs, the tap controller determines the test functionality to be implemented. this includes either loading the jtag instruction register (ir), or beginning a serial data scan through a data register (dr), listed in table 6.3.1 . as the data is scanned in, the state of the jtms pin signals each new data word, and indicates the end of the data stream. the data register to be selected is determined by the contents of the instruction register. 6.3.1 instruction register the jtag instruction register includes eight shift regist er-based cells; this register is used to select the test to be performed and/or the test data register to be accessed. as listed in table 6.3.1 , this encoding selects either the boundary-scan re gister or the bypass register or device identification register. table 6.3.1 jtag instruction register bit encoding instruction code (msb lsb) instruction selected data register 0000 extest boundary scan register 0001 sample/preload boundary scan register 0010 to 1110 reserved reserved 1111 bypass bypass register figure 66.3 .1 shows the format of the instruction register 3 2 1 0 msb lsb figure 66.3.1 instruction register the instruction code is shifted out to the instruction register from the lsb. lsb msb tdi tdo figure 6.3.2 instruction register shift direction tmp1942cy/cz-387
tmp1942cy/cz tmp1942cy/cz-388 6.3.2 bypass register the bypass register is 1 bit wide. when the tap contro ller is in the shift-dr (bypass) state, the data on the tdi pin is shifted into the bypass register, and the bypass register output shifts to the tdo output pin. in essence, the bypass register is a short-circuit wh ich allows bypassing of board-level devices, in the serial boundary-scan chain, which are not required fo r a specific test. the logical location of the bypass register in the boundary-scan chain is shown in figure 6.3.3. use of the bypass register speeds up access to boundary-scan registers in those ics that remain active in the board-level test datapath. figure 6.3.3 bypass register operation 6.3.3 boundary-scan register the boundary scan register includes all of the inputs and outputs of the tmp1942 processor, except some analog output and control signals. the pins of the tmp1942 chip can be configured to drive any arbitrary pattern by scanning into the boundary scan register from the shift-dr state. incoming data to the processor is examined by shifting while in the captur e-dr state with the boundar y scan register enabled. the boundary-scan register is a single, 115-bit- wide, shift register-based path containing cells connected to all input and output pads on the tmp1942 processor. the tdi input is loaded to the lsb of the bound ary scan register. the msb of the boundary scan register is retrieved from the jtdo output. jtdo board input ic package board jtdi bypass register boundary-scan register pad cell board output jtdi jtdi jtdo jtdo jtdo jtdi jtdo jtdi
tmp1942cy/cz 6.3.4 test access port (tap) the test access port (tap) consists of the five signal pins: trst , tdi, tdo , tms , and tck . serial test data and instructions are communicated over these five signal pins, along with control of the test to be executed. as figure shows, data is serially scanned into one of the three registers (instruction register, bypass register, or the boundary- scan register) from the tdi pin, or it is scanned from one of these three registers onto the tdo pin. the tms input controls the state transitions of the main tap controller state machine. the tck input is a dedicated test clock that allows serial jtag data to be shifted synchronously, independent of any chip-specific or system clocks. tck data scanned out serially tdo sampled on falling edge of tck tms and tdi sampled on rising edge of tck data scanned in serially tdi pin tms pin tdo pin 0 0 3 instruction register bypass register 115 boundary-scan registe 0 0 0 3 instruction register bypass register 115 boundary-scan register 0 figure 6.3.4 jtag test access port data on the tdi and tms pins is sampled on the rising edge of the tck input clock signal. data on the tdo pin changes on the falling edge of the tck clock signal. 6.3.5 tap controller the processor implements the 16-state tap controller as defined in the ieee jtac specification. 6.3.6 controller reset the tap controller state machine can be put into reset state the following: ? assertion of the trst signal (low) resets the tap controller. ? keeping the tms input signal asserted through five consecutive rising edges of tck input. in either case, keeping tms asserted maintains the reset state. tmp1942cy/cz-389
tmp1942cy/cz 6.3.7 tap controller the state transition diagram of the tap controller is shown in figure 6.3.5. each arrow between states is labeled with a 1 or 0, indicating the logic value of tms that must be set up before the rising edge of tck to cause the transition. test-logic-reset 1 0 0 1 0 1 run-test/idle select-dr-scan 1 1 capture-dr 0 shift-dr 1 exit 1-dr 0 pause-dr 1 exit 2-dr 1 update-dr 0 1 0 0 1 select-ir-scan capture-ir 0 shift-ir 1 exit 1-ir 0 pause-ir 1 exit 2-ir 1 update-ir 0 1 1 00 1 0 0 0 figure 6.3.5 tap controller state diagram the following paragraphs describe each of the controller states. the left vertical column in figure 6.3.5 is the data column, and the right vertical column is the instruction column. the data column and instruction column reference data register (dr) and instruction register (ir), respectively. tmp1942cy/cz-390
tmp1942cy/cz ? test-logic-reset when the tap controller is in the reset state, th e device identification register is selected as default. the three most significant bits of the bo undary-scan register are cleared to 0, disabling the outputs. the controller remains in this state while tms is high. if tms is held low while the controller is in this state, then the controller moves to the run-test/idle state. ? run-test/idle in the run-test/idle state, the ic is put in a test mode only when certain instructions such as a built-in self test (bist) instruc tion are present. for instructions that do not cause any activities in this state, all test data registers selected by the current instruction retain their previous states. the controller remains in this state while tms is held low. when tms is high, the controller moves to the select-dr-scan state. ? select-dr-scan this is a temporary controller state. here, the ic does not execute any specific functions. if tms is held low when the controller is in this state, then the controller moves to the capture-dr state. if tms is held high, the c ontroller moves to the select-ir-scan state in the instruction column. ? select-ir-scan this is a temporary controller state. here, the ic does not execute any specific functions. if tms is held low when the controller is in this state, then the controller moves to the capture-ir state. if tms is held high, the controller returns to the test-logic-reset state. ? capture-dr in this controller state, if the test data register selected by the current instruction on the rising edge of tck has parallel inputs, then data can be parallel-loaded into the shift portion of the data register. if the test data register does not have parallel inputs, or if data need not be loaded into the selected data register, then the data register retains its previous state. if tms is held low while the controller is in this state, the controller moves to the shift-dr state. if tms is held high, the controller moves to the exit1-dr state. ? shift-dr in this controller state, the test data regist er connected between tdi and tdo shifts data one stage forward towards its serial output. when the controller is in this state, then it remain s in the shift-dr state if tms is held low, or moves to the exit1-dr state if tms is held high. tmp1942cy/cz-391
tmp1942cy/cz ? exit 1-dr this is a temporary controller state. if tms is held low when the controller is in th is state, the controller moves to the pause-dr state. if tms is held high, the cont roller moves to the update-dr state. ? pause-dr this state allows the shifting of the data register selected by the instruction register to be temporarily suspended. both the instruction register and the data register retain their current states. when the controller is in this state, then it remain s in the pause-dr state if tms is held low, or moves to the exit2-dr state if tms is held high. ? exit 2-dr this is a temporary controller state. when the controller is in this state, then it return s to the shift-dr state if tms is held low, or moves on to the update-dr state if tms is held high. ? update-dr in this state, data is latched, on the falling edge of tck, onto the parallel outputs of the data registers from the shift register path. the data held at the parallel output does not change while data is shifted in the associated shift register path. when the controller is in this state, it moves to either the run-test/idle state if tms is held low, or the select-dr-scan stat e if tms is held high. ? capture-ir in this state, data is parallel-loaded into the in struction register. the two least significant bits are assigned the values ?01?. the higher-order bits of the instruction register can receive any design specific values. the capture-ir state is used for testing the instruction register. faults in the instruction register, if any exist, may be detected by shifting out the data loaded in it. when the controller is in this state, it moves to either the shift-ir state if tms is low, or the exit1-ir state if tms is high. ? shift-ir in this state, the instruction register is conne cted between tdi and tdo and shifts the captured data toward its serial output on the rising edge of tck. when the controller is in this state, it remains in the shift-ir state if tms is low, or moves to the exit1-ir state if tms is high. tmp1942cy/cz-392
tmp1942cy/cz ? exit 1-ir this is a temporary controller state. when the controller is in this state, it moves to e ither the pause-ir state if tms is held low, or the update-ir state if tms is held high. ? pause-ir this state allows the shifting of the instruction register to be temporarily suspended. both the instruction register and the data re gister retain their current states. when the controller is in this state, it remains in the pause-ir state if tms is held low, or moves to the exit2-ir state if tms is held high. ? exit 2-ir this is a temporary controller state. when the controller is in this state, it moves to either the shift-ir state if tms is held low, or the update-ir state if tms is held high. ? update-ir this state allows the instruction previously shifted into the instruction register to be output in parallel on the rising edge of tck. then it becomes the current instruction, setting a new operational mode. when the controller is in this state, it moves to either the run-test/idle state if tms is low, or the select-dr-scan state if tms is high. table 6.3.2 shows the boundary scan order of the processor signals. table 6.3.2 tmp1942 jtag boundary-scan ordering [tdi] 1:p50 2: p51 3:p52 4: p53 5:p54 6:p55 7: p56 8: p57 9: p60 10: p61 11: 62 12: p63 13: p64 14: p65 15: p66 16: p67 17: p00 18:p01 19: p02 20: p03 21: p04 22: p05 23:p06 24: p07 25: p10 26: p11 27: p12 28: p13 29: p14 30: p15 31: p16 32: p17 33: p20 34: p21 35: p22 36: p23 37: p24 38: p25 39: p26 40:p27 41: ale 42: bw1 43: p30 44: p31 45: p32 46: p33 47: p34 48: p35 49: p36 50: p37 51:p40 52:p41 53:p42 54:p43 55:p44 56: p90 57: p91 58: p92 59: p93 60: p94 61: p95 62: p96 63: p97 64: pa0 65: pa1 66: pa2 67: pa3 68: pa4 69: pa5 70: pa6 71: pa7 72:rstpup 73: pc0 74: pc1 75: pc2 76:pc3 77:pc4 78:pc5 79: pc6 80:pc7 81:pf0 82: pf1 83: pf2 84: pf3 85: pf4 86: pf5 87: pf6 88:test1 89:reset 90:pd6 91:pd7 92:nmi 93:bw0 94:pb0 95:pb1 96:pb2 97:pb3 98:pb4 99:pb5 100:pb6 101:pb7 102:pd0 103:pd1 104:pd2 105:pd3 106:pd4 107:pd5 108:pe0 109:pe1 110:pe2 111:pe3 112:pe4 113:pe5 114:pe6 115:pe7 [tdo]: tmp1942cy/cz-393
tmp1942cy/cz 6.4 instructions for jtag this section defines the instructions supplied and the operations that occur in response to those instructions. 6.4.1 the extest instruction this instruction is used for external interconnect test, and targets the boundary scan register between tdi and tdo. the extest instruction permits bsr cells at output pins to shift out test patterns in the update-dr state and those at input pins to capture test results in the capture-dr state. typically, before extest is executed, the initializati on pattern is first shifted into the boundary scan register using the sample/preload instruction. in the update-dr state, the boundary scan register loaded with the initialization pattern causes known data to be driven immediately from the ic onto its external interconnects. this eliminates the possibility of bus conflicts damaging the ic outputs. the flow of data through the boundary scan register while the extest instruction is selected is shown in figure 6.4.1 , which follows: core logic output tdo input tdi boundary scan path figure 6.4.1 test data flow while the extest instruction is selected the following steps describe the basic test algorithm of an external interconnect test. 1. initialize the tap controller to the test-logic-reset state. 2. load the instruction register with sample/preload. this causes the boundary scan register to be connected between tdi and tdo. 3. initialize the boundary scan register by shifting in determinate data. 4. then, load the initial test data into the boundary scan register. 5. load the instruction register with extest. 6. capture the data applied to the input pin into the boundary scan register. 7. shift out the captured data while simultaneously shifting in the next test pattern. 8. read out the data in the boundary scan register onto the output pin. steps 6 to 8 are repeated for each test pattern. tmp1942cy/cz-394
tmp1942cy/cz tmp1942cy/cz-395 6.4.2 the sample/preload instruction this instruction targets the boundar y scan register between tdi and tdo. as the instruction's name implies, two functions are performed through use of the sample/ preload instruction. ? sample allows the input and output pads of an ic to be monitored. while it does so, it does not disconnect the system logic from the ic pins. the sample function occurs in the capture-dr controller state. an example application of sample is to take a snapshot of the activity of the ic's i/o pins so as to verify the interaction between ics during normal functional operation. the flow of data for the sample phase of the samp le/preload instruction is shown in figure 6.4.2 . figure 6.4.2 test data flow while sample is selected ? preload allows the boundary scan register to be initialized before another instruction is selected. for example, prior to selection of the extest instruction, initialization data is shifted into the boundary scan register using preload as described in the previous subsection. preload permits shifting of the boundary scan register without interfering with the normal operation of the system logic. the flow of data for the preloa d phase of the sample/p reload instruction is shown in figure 6.4.3 . figure 6.4.3 test data flow while preload is selected 6.4.3 the bypass instruction this instruction targets the bypass register between jtdi and jtdo. the bypass register provides a minimum length serial path through the ic (or between jtdi and jtdo) when the ic is not required for the current test. the bypass instruction does not cause interference to the normal operation of the on-chip system logic. the flow of data through the bypass register while the bypass instruction is selected is shown in figure 6.4.4 . figure 6.4.4 test data flow while the bypass instruction is selected output tdo input tdi boundary scan path core logic tdo tdi bypass register 1-bit core logic output tdo input tdi boundary scan path
tmp1942cy/cz 6.5 note this section describes details of jtag boundary-scan operation that are specific to the processor. ? the daout0, 1, 2, x2 , and x1 signal pads do not support jtag. ? reset for jtag (1) jtag circuit is initialized by trst assertion. and then deassert trst . (2) at input to tms = 1 and asserted for more 5 tck cycles. tmp1942cy/cz-396
tmp1942cy/cz tmp1942cy/cz-397 7 i/o port equivalent-circuit diagrams ? how to read circuit diagrams the circuit diagrams in this chapter are drawn using the same gate symbols as for the 74hcxx series standard cmos logic ics. the signal named stop has a unique function. this signal goes active-high if the cpu sets the halt bit when the stby[1:0] field in the syscr2 register is programmed to 01 (i.e., stop mode) and the drive enable (frve) bit in the same regist er is cleared. if the drve bit is set, the stop signal remains inactive (at logic 0). ? the input protection circuit has a resistor in the range of several tens to several hundreds of ohms. p0(d0 to d7 / ad0 to ad7), p1(d 8 to d15 / ad8 to ad15, a8 to a 15), p2(a16 to a23, a0 to a7), p92 to p97, pa0 to pa6, pb0 to pb6, pc0 to pc5, pc7, pd0, pd1, pd4, pe1, pe4, pe6, pe7, pf3, pf6 p30( rd ), p31( wr ), dclk, pcst3 to pcst0, sdao / tpc, tdo p32 to p36, p40 to p43 vcc output data p-ch in p ut/out p ut input data output enable stop input enable n-ch output vcc out p ut data stop n-ch input/output input enable vcc output data output enable stop input data vcc programmable pull-up resistor p-ch
tmp1942cy/cz tmp1942cy/cz-398 p5 (an0 to an7) p6 (an8 to an15) pd2, pd3, pd5, pe0, pe2, pe3, pe5, pf0, pf2, pf4, pf5 p90, p91, pa7, pb7, pc6, pf1 a nalog input channel select input input data analog input input enable in p ut/out p ut input enable vcc out p ut data output enable s t o p input data open-drain output enable p-ch n-ch a nalog input channel select input input data analog input input enable programmable pull-up resistor vcc pull-up control n-ch input/output input enable vcc output data output enable stop input data vcc p-ch pull-up control programmable pull-up resistor
tmp1942cy/cz pd6 (xt1), pd7 (xt2) pd6(xt1) pd7(xt2) input enable clock output data stop input data input enable low-frequency oscillator enable input data output data output enable output enable oscillator circuit nmi , bw0 to bw1, plloff , rstpup input nmi plloff schmitt-trigger reset input wdtout reset reset enable schmitt-trigger vcc dreset, dbge, sdi/dint, tck, tms, tdi trst debag reset input vcc schmitt-trigger schmitt-trigger input test reset tmp1942cy/cz-399
tmp1942cy/cz x1, x2 x2 high-frequency oscillator enable oscillator circuit clock x1 vrefh, vrefl vrefh vrefon ladder resistor p-ch vrefl tmp1942cy/cz-400
tmp1942cy/cz 8. notations, precautions and restrictions 8.1 notations and terms (1) i/o register fields are often referred to as . for the interest of brevity. for example, trun.t0run means the t0run bit in the trun register. (2) fc, fs, fsys, state fosc: clock supplied from the x1 and x2 pins fpll: clock generated by the on-chip pll fc: clock selected by the plloff pin fs: clock supplied from the xt1 and xt2 pins fgear: clock selected by the syscr1.gear[1:0] bits fsys: clock selected by the syscr1.sysck bit the fsys cycle is referred to as a state. in addition, the clock selected by the syscr1.fpsel bit and the prescaler clock source selected by the syscr0.prck[1:0] bits are referred to as fperiph and t0 respectively. 8.2 precautions and restrictions (1) processor revision identifier the process revision identifier (prid) register in the tx19 core of the tmp1942 contains 0x0000_2c91. (2) bw0 to bw1 pins the bw0 and bw1 pins must be connected to the dvcc pin to ensure that their signal levels do not fluctuate during chip operation. (3) oscillator warm-up counter if an external crystal is utilized, an interrupt si gnal programmed to bring the tmp1942 out of stop mode triggers the on-chip warm-up counter. the system clock is not supplied to the on-chip logic until the warm-up counter expires. (4) programmable pull-up resistors when port pins are configured as input ports, the integrated pull-up resistors can be enabled and disabled under software control. the pull-up resistors are not programmable when port pins are configured as output ports. the relevant port registers are pr ogrammed with the data resistor. (5) external bus mastership the pin states while the bus is granted to an extern al device are described in chapter 7, i/o ports. (6) watchdog timer (wdt) upon reset, the wdt is enabled. if the watchdog timer function is not required, it must be disabled after reset. when relevant pins are configured as bus ar bitration signals, the i/o peripherals including the wdt can operate during exte rnal bus mastership. (7) a/d converter (adc) the ladder resistor network between the vrefh and vrefl pins can be disconnected under software control. this helps to reduce power dissipation, for example, in stop mode. tmp1942cy/cz-401
tmp1942cy/cz tmp1942cy/cz-402 (8) undefined bits in i/o registers undefined i/o register bits are read as undefined states. therefore, software must be coded without relying on the states of any undefined bits. (9) notations, precautions and restrictions overflow exception #1 problem: when an overflow exception is taken, the epc register might contain an incorrect return address, pointing to the instruction immediately following the one that caused an overflow. the restart location in the epc register should be the address of the arithmetic instruction that caused the exception, rather than the following instruction. in the above example, the processo r writes address n to the epc register upon detection of an overflow. however, executing the next instruction generates an interrupt at the same time, causing the processor to rewrite the epc register with ad dress n+4 in the next cycle. ? problem-causing situation: a) software uses the add, addi or sub instruction in the 32-bit isa. b) the add, addi or sub inst ruction causes an overflow. c) another exception is requested simultaneously with the overflow. this problem occurs when all of these conditions are true. workarounds: ? before returning from the overflow exception handler, determine whether the instruction pointed to by the epc regi ster caused an overflow. ? make sure that two arithmetic instructions will not appear consecutively. ? disable interrupts prior to arithmetic instructions. you should always use one of these workarounds to avoid this problem. note: toshiba?s compiler uses no instructions t hat could cause an overflow. therefore, since condition c) above never becomes true, this problem does not occur. n arithmetic instruction (e.g., add) n + 4 next instruction f instruction pipeline epc register d e m w f d e m w n n + 4 detects an overflow and writes to epc. detects an interrupt. writes to epc.
tmp1942cy/cz overflow exception #2 problem: if an overflow exception caused a jump to the exception handler and the first instruction in that exception handler caused another exception, the epc register should point to the address of the first instruction in the exception handler. however, the epc re gister might contain the address th at caused the overflow exception. ? problem-causing situation: when, with the instruction pipeline full, an overflow exception was taken at the following sequence of instructions and then the first instruction in the overflow exception handler causes another exception add, addi or sub <= # instruction that causes an overflow jump or branch instruction <= # instruction with a delay slot delay slot note: toshiba?s compiler uses no instructions that could cause an overflow. therefore, this problem does not occur. workaround: don?t place a jump or branch inst ruction immediately following an instruction that could cause an overflow (add, addi or sub). tmp1942cy/cz-403
tmp1942cy/cz lwl and lwr instructions problem: the lwl or lwr instruction might provide incorrect results. ? problem-causing situation #1: a. the destination of a load instruction (lb, lbu, lh, lhu, lw, lwl or lwr) is identical to that of the lwl or lwr instruction. b. the instruction pipeline is full. (the load in struction and the lwl or lwr instruction will be executed consecutively.) c. the dmac is programmed for data cache snooping. once the load instruction is executed, the dmac initiates a dma transaction. after it has been serviced, the lwlor lwr instruction is executed. this problem occurs when all of these conditions are true. ? problem-causing situation #2: a. the destination of a load instruction (lb, lbu, lh, lhu, lw, lwl or lwr) is identical to that of the lwl or lwr instruction. b. the doze or halt bit in the config register is set to 1 immediately before the load instruction. c. the instruction pipeline is full. (the load in struction and the lwl or lwr instruction will be executed consecutively.) d. after the load instruction is executed, the processor is put in the stop, sleep or idle mode. e. after an interrupt signaling brings the processor out of the stop, sleep or idle mode, the lwl or lwr instruction is executed. note: this applies to the case in which an interrupt signaling does not generate an interrupt upon exit from stop, sleep or idle mode. in other words, either the iec bit in the status register is cleared (interr upts disabled), or if the iec bit is set, the priority level of the incoming interrupt signaling is lower than the mask level programmed in the cmask field in the status register. (exit from stop, sleep or idle mode can be accomplished even with such settings.) this problem occurs when all of these conditions are true. workarounds: to use the lwl or lwr instruction, 1) place a nop between a load instructio n and the lwl or lwr instruction, or 2) disable the data cache snooping of the dmac be fore the lwl or lwr instruction is executed. also, don?t put the processor in stop, sleep or idle mode before the lwl or lwr instruction is executed. tmp1942cy/cz-404
tmp1942cy/cz overflow exception when a dsu probe is used problem: it looks as if an overflow exception caused a jump to the reset and nonmaskable exception vector address (0xbfc0_0000). ? problem-causing situation: when an overflow exception occurs, with the processor connected to a dsu probe note: toshiba?s compiler uses no instructions that could cause an overflow. therefore, this problem does not occur. workaround: don?t place a jump or branch inst ruction immediately following an instruction that could cause an overflow (add, addi or sub). idle (doze) mode problem: a deadlock might occur when returning to normal operating mode from idle (doze) mode. ? problem-causing situation: when the dmac initiates a dma transaction with snooping enabled after the doze bit in the config register is set and before the cpu clock stops. workaround: if snooping is enabled, stop the dmac before putting the processor in idle (doze) mode. tmp1942cy/cz-405


▲Up To Search▲   

 
Price & Availability of TMP1942CZUE

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X